Skip to content

Commit

Permalink
修复启动加载慢的问题#59
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Dec 5, 2023
1 parent d7604bf commit 6b1c866
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/ui_pc/chat/chat_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def show_chats(self):
self.show_chat_thread = ShowChatThread(self.contact)
self.show_chat_thread.showSingal.connect(self.add_message)
self.show_chat_thread.finishSingal.connect(self.show_finish)
self.show_chat_thread.start()
# self.show_chat_thread.start()

def show_finish(self, ok):
self.setScrollBarPos()
Expand Down
5 changes: 5 additions & 0 deletions app/ui_pc/chat/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, parent=None):
self.contacts = [[], []]
self.init_ui()
self.show_chats()
self.visited = set()

def init_ui(self):
search_action = QAction(self.lineEdit)
Expand Down Expand Up @@ -112,6 +113,10 @@ def show_chat(self, contact):
def setCurrentIndex(self, row):
# print(row)
self.stackedWidget.setCurrentIndex(row)
if row not in self.visited:
chat_info_window = self.stackedWidget.currentWidget()
chat_info_window.update_history_messages()
self.visited.add(row)

def stop_loading(self, a0):
# self.label.setVisible(False)
Expand Down

0 comments on commit 6b1c866

Please sign in to comment.