Skip to content

Commit

Permalink
Quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffser committed May 19, 2024
1 parent 8ee265f commit 9f00890
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def open_image(self, button):
def chat_delete(self, dialog, task, chat_name):
if dialog.choose_finish(task) == "delete":
del self.chats['chats'][chat_name]
#self.save_history()
self.save_history()
self.update_chat_list()

def chat_delete_dialog(self, chat_name):
Expand Down Expand Up @@ -774,14 +774,14 @@ def update_chat_list(self):
if name==self.chats["selected_chat"]: self.chat_list_box.select_row(chat)

def chat_changed(self, listbox, row):
if row or row.get_title() != self.chats["selected_chat"]:
if row and row.get_title() != self.chats["selected_chat"]:
self.chats["selected_chat"] = row.get_title()
self.load_history_into_chat()
if len(self.chats["chats"][self.chats["selected_chat"]]["messages"]) > 0:
for i in range(self.model_string_list.get_n_items()):
if self.model_string_list.get_string(i) == self.chats["chats"][self.chats["selected_chat"]]["messages"][-1]["model"]:
self.model_drop_down.set_selected(i)
break
if len(self.chats["chats"][self.chats["selected_chat"]]["messages"]) > 0:
for i in range(self.model_string_list.get_n_items()):
if self.model_string_list.get_string(i) == self.chats["chats"][self.chats["selected_chat"]]["messages"][-1]["model"]:
self.model_drop_down.set_selected(i)
break


def selected_model_changed(self, pspec=None, user_data=None):
Expand Down

0 comments on commit 9f00890

Please sign in to comment.