From 508993de75a5a1bc03afde8dc9a267373e2c3fe3 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Tue, 20 Jun 2023 18:30:17 -0400 Subject: [PATCH] Exit early when no chats are saved. --- gpt4all-chat/chatlistmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpt4all-chat/chatlistmodel.cpp b/gpt4all-chat/chatlistmodel.cpp index e1c184ec..5958c86f 100644 --- a/gpt4all-chat/chatlistmodel.cpp +++ b/gpt4all-chat/chatlistmodel.cpp @@ -84,8 +84,10 @@ void ChatListModel::saveChats() continue; toSave.append(chat); } - if (toSave.isEmpty()) + if (toSave.isEmpty()) { + emit saveChatsFinished(); return; + } ChatSaver *saver = new ChatSaver; connect(this, &ChatListModel::requestSaveChats, saver, &ChatSaver::saveChats, Qt::QueuedConnection);