Fix ui.Select.values in modals

This commit is contained in:
Mikey
2022-08-14 12:25:43 -07:00
committed by GitHub
parent 584c22f642
commit 9c38cf3aef
3 changed files with 18 additions and 11 deletions

View File

@ -416,6 +416,8 @@ class View:
if self.timeout:
self.__timeout_expiry = time.monotonic() + self.timeout
item._refresh_state(interaction.data) # type: ignore
allow = await self.interaction_check(interaction)
if not allow:
return
@ -615,7 +617,6 @@ class ViewStore:
if item is None:
return
item._refresh_state(interaction.data) # type: ignore
# Note, at this point the View is *not* None
item.view._dispatch_item(item, interaction) # type: ignore
@ -630,8 +631,7 @@ class ViewStore:
_log.debug("Modal interaction referencing unknown custom_id %s. Discarding", custom_id)
return
modal._refresh(components)
modal._dispatch_submit(interaction)
modal._dispatch_submit(interaction, components)
def remove_interaction_mapping(self, interaction_id: int) -> None:
# This is called before re-adding the view