mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-11-20 15:51:30 +00:00
Detach view from item when removed
This commit is contained in:
@@ -439,6 +439,7 @@ class BaseView:
|
||||
pass
|
||||
else:
|
||||
self._add_count(-item._total_count)
|
||||
item._update_view(None)
|
||||
|
||||
return self
|
||||
|
||||
@@ -448,6 +449,9 @@ class BaseView:
|
||||
This function returns the class instance to allow for fluent-style
|
||||
chaining.
|
||||
"""
|
||||
for child in self._children:
|
||||
child._update_view(None)
|
||||
|
||||
self._children.clear()
|
||||
self._total_children = 0
|
||||
return self
|
||||
@@ -744,6 +748,8 @@ class View(BaseView):
|
||||
pass
|
||||
else:
|
||||
self.__weights.remove_item(item)
|
||||
item._update_view(None)
|
||||
|
||||
return self
|
||||
|
||||
def clear_items(self) -> Self:
|
||||
|
||||
Reference in New Issue
Block a user