mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-15 18:29:52 +00:00
Fix Modal.stop sometimes not removing from the store
This commit is contained in:
parent
4ad6146069
commit
2b600241a4
@ -503,13 +503,13 @@ class ViewStore:
|
|||||||
del self._views[k]
|
del self._views[k]
|
||||||
|
|
||||||
def add_view(self, view: View, message_id: Optional[int] = None):
|
def add_view(self, view: View, message_id: Optional[int] = None):
|
||||||
|
view._start_listening_from_store(self)
|
||||||
if view.__discord_ui_modal__:
|
if view.__discord_ui_modal__:
|
||||||
self._modals[view.custom_id] = view # type: ignore
|
self._modals[view.custom_id] = view # type: ignore
|
||||||
return
|
return
|
||||||
|
|
||||||
self.__verify_integrity()
|
self.__verify_integrity()
|
||||||
|
|
||||||
view._start_listening_from_store(self)
|
|
||||||
for item in view.children:
|
for item in view.children:
|
||||||
if item.is_dispatchable():
|
if item.is_dispatchable():
|
||||||
self._views[(item.type.value, message_id, item.custom_id)] = (view, item) # type: ignore
|
self._views[(item.type.value, message_id, item.custom_id)] = (view, item) # type: ignore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user