Skip to content

Commit 83e6cca

Browse files
committed
Fixed fallback when deleting all chats
1 parent 6163ea9 commit 83e6cca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/widgets/chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,13 @@ def prompt_rename(self):
441441

442442
def delete(self):
443443
self.chat.stop_message()
444+
window = self.get_root()
444445
list_box = self.get_parent()
445446
list_box.remove(self)
446447
self.chat.get_parent().remove(self.chat)
447448
SQL.delete_chat(self.chat)
448449
if len(list(list_box)) == 0:
449-
self.get_root().new_chat(chat_type='chat')
450+
window.new_chat(chat_type='chat')
450451
if not list_box.get_selected_row() or list_box.get_selected_row() == self:
451452
list_box.select_row(list_box.get_row_at_index(0))
452453

0 commit comments

Comments
 (0)