Another attempt to refresh mute state for channels

Clean up navigation stack styles
This commit is contained in:
Garth Vander Houwen 2022-12-01 08:20:21 -08:00
parent 861d824183
commit 76b7127b68
3 changed files with 4 additions and 5 deletions

View file

@ -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)
}

View file

@ -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")

View file

@ -203,7 +203,6 @@ struct ExternalNotificationConfig: View {
if newUsePWM != node!.externalNotificationConfig!.usePWM { hasChanges = true }
}
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
}