Browse Source
Use walk_children within remove_view
pull/10406/head
Michael
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
2 deletions
-
discord/ui/view.py
|
|
|
@ -913,14 +913,14 @@ class ViewStore: |
|
|
|
if message_id is not None and not is_fully_dynamic: |
|
|
|
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__: |
|
|
|
self._modals.pop(view.custom_id, None) # type: ignore |
|
|
|
return |
|
|
|
|
|
|
|
dispatch_info = self._views.get(view._cache_key) |
|
|
|
if dispatch_info: |
|
|
|
for item in view._children: |
|
|
|
for item in view.walk_children(): |
|
|
|
if isinstance(item, DynamicItem): |
|
|
|
pattern = item.__discord_ui_compiled_template__ |
|
|
|
self._dynamic_items.pop(pattern, None) |
|
|
|
|