mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-03-05 03:02:49 +00:00
Use walk_children within remove_view
This commit is contained in:
@@ -913,14 +913,14 @@ class ViewStore:
|
|||||||
if message_id is not None and not is_fully_dynamic:
|
if message_id is not None and not is_fully_dynamic:
|
||||||
self._synced_message_views[message_id] = view
|
self._synced_message_views[message_id] = view
|
||||||
|
|
||||||
def remove_view(self, view: View) -> None:
|
def remove_view(self, view: BaseView) -> None:
|
||||||
if view.__discord_ui_modal__:
|
if view.__discord_ui_modal__:
|
||||||
self._modals.pop(view.custom_id, None) # type: ignore
|
self._modals.pop(view.custom_id, None) # type: ignore
|
||||||
return
|
return
|
||||||
|
|
||||||
dispatch_info = self._views.get(view._cache_key)
|
dispatch_info = self._views.get(view._cache_key)
|
||||||
if dispatch_info:
|
if dispatch_info:
|
||||||
for item in view._children:
|
for item in view.walk_children():
|
||||||
if isinstance(item, DynamicItem):
|
if isinstance(item, DynamicItem):
|
||||||
pattern = item.__discord_ui_compiled_template__
|
pattern = item.__discord_ui_compiled_template__
|
||||||
self._dynamic_items.pop(pattern, None)
|
self._dynamic_items.pop(pattern, None)
|
||||||
|
|||||||
Reference in New Issue
Block a user