Exit early when no chats are saved.

This commit is contained in:
Adam Treat 2023-06-20 18:30:17 -04:00
parent bd58c46da0
commit 508993de75

View File

@ -84,8 +84,10 @@ void ChatListModel::saveChats()
continue; continue;
toSave.append(chat); toSave.append(chat);
} }
if (toSave.isEmpty()) if (toSave.isEmpty()) {
emit saveChatsFinished();
return; return;
}
ChatSaver *saver = new ChatSaver; ChatSaver *saver = new ChatSaver;
connect(this, &ChatListModel::requestSaveChats, saver, &ChatSaver::saveChats, Qt::QueuedConnection); connect(this, &ChatListModel::requestSaveChats, saver, &ChatSaver::saveChats, Qt::QueuedConnection);