From 76b7127b684b45bd6081e93f01b87df96ac1c96f Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 1 Dec 2022 08:20:21 -0800 Subject: [PATCH] Another attempt to refresh mute state for channels Clean up navigation stack styles --- Meshtastic/Views/Messages/ChannelMessageList.swift | 3 --- Meshtastic/Views/Messages/Contacts.swift | 5 ++++- .../Settings/Config/Module/ExternalNotificationConfig.swift | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Meshtastic/Views/Messages/ChannelMessageList.swift b/Meshtastic/Views/Messages/ChannelMessageList.swift index 3854f7e8..6b61a9da 100644 --- a/Meshtastic/Views/Messages/ChannelMessageList.swift +++ b/Meshtastic/Views/Messages/ChannelMessageList.swift @@ -29,7 +29,6 @@ struct ChannelMessageList: View { @State private var deleteMessageId: Int64 = 0 @State private var replyMessageId: Int64 = 0 @State private var sendPositionWithMessage: Bool = false - //@State private var refreshId = UUID() var body: some View { NavigationStack { @@ -218,13 +217,11 @@ struct ChannelMessageList: View { .scrollDismissesKeyboard(.immediately) .onAppear(perform: { self.bleManager.context = context - // refreshId = UUID() if channel.allPrivateMessages.count > 0 { scrollView.scrollTo(channel.allPrivateMessages.last!.messageId) } }) .onChange(of: channel.allPrivateMessages, perform: { messages in - // refreshId = UUID() if channel.allPrivateMessages.count > 0 { scrollView.scrollTo(channel.allPrivateMessages.last!.messageId) } diff --git a/Meshtastic/Views/Messages/Contacts.swift b/Meshtastic/Views/Messages/Contacts.swift index 17afdf04..844be0c0 100644 --- a/Meshtastic/Views/Messages/Contacts.swift +++ b/Meshtastic/Views/Messages/Contacts.swift @@ -89,7 +89,10 @@ struct Contacts: View { do { try context.save() - self.context.refresh(channel, mergeChanges: true) + // Would rather not do this but the merge changes on + // A single object is only working on mac GVH + context.refreshAllObjects() + //context.refresh(channel, mergeChanges: true) } catch { context.rollback() print("💥 Save Channel Mute Error") diff --git a/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift b/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift index 2d703880..3e3c4bc0 100644 --- a/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/ExternalNotificationConfig.swift @@ -203,7 +203,6 @@ struct ExternalNotificationConfig: View { if newUsePWM != node!.externalNotificationConfig!.usePWM { hasChanges = true } } } - .navigationViewStyle(StackNavigationViewStyle()) } } }