From f1c099d8e6f0c113affc010300cc5d6f9c5f38cc Mon Sep 17 00:00:00 2001 From: maiqingqiang <867409182@qq.com> Date: Sat, 21 Sep 2024 23:01:51 +0800 Subject: [PATCH] :bug: Fix clearAllConversations error --- ChatMLX/Features/Settings/GeneralView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/ChatMLX/Features/Settings/GeneralView.swift b/ChatMLX/Features/Settings/GeneralView.swift index 333617c..67a732a 100644 --- a/ChatMLX/Features/Settings/GeneralView.swift +++ b/ChatMLX/Features/Settings/GeneralView.swift @@ -132,6 +132,7 @@ struct GeneralView: View { private func clearAllConversations() { do { try modelContext.delete(model: Conversation.self) + try modelContext.save() conversationViewModel.selectedConversation = nil } catch { logger.error("Error deleting all conversations: \(error)")