mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix channel mute bug
This commit is contained in:
parent
789203d273
commit
3fca3a1ca7
3 changed files with 5 additions and 6 deletions
|
|
@ -29,7 +29,7 @@ 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()
|
||||
//@State private var refreshId = UUID()
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
|
|
@ -218,13 +218,13 @@ struct ChannelMessageList: View {
|
|||
.scrollDismissesKeyboard(.immediately)
|
||||
.onAppear(perform: {
|
||||
self.bleManager.context = context
|
||||
refreshId = UUID()
|
||||
// refreshId = UUID()
|
||||
if channel.allPrivateMessages.count > 0 {
|
||||
scrollView.scrollTo(channel.allPrivateMessages.last!.messageId)
|
||||
}
|
||||
})
|
||||
.onChange(of: channel.allPrivateMessages, perform: { messages in
|
||||
refreshId = UUID()
|
||||
// refreshId = UUID()
|
||||
if channel.allPrivateMessages.count > 0 {
|
||||
scrollView.scrollTo(channel.allPrivateMessages.last!.messageId)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,10 @@ struct Contacts: View {
|
|||
.contextMenu {
|
||||
Button {
|
||||
channel.mute = !channel.mute
|
||||
|
||||
do {
|
||||
try context.save()
|
||||
self.context.refresh(channel, mergeChanges: true)
|
||||
} catch {
|
||||
context.rollback()
|
||||
print("💥 Save Channel Mute Error")
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ struct UserMessageList: 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 {
|
||||
|
|
@ -220,13 +219,11 @@ struct UserMessageList: View {
|
|||
.scrollDismissesKeyboard(.immediately)
|
||||
.onAppear(perform: {
|
||||
self.bleManager.context = context
|
||||
refreshId = UUID()
|
||||
if user.messageList.count > 0 {
|
||||
scrollView.scrollTo(user.messageList.last!.messageId)
|
||||
}
|
||||
})
|
||||
.onChange(of: user.messageList, perform: { messages in
|
||||
refreshId = UUID()
|
||||
if user.messageList.count > 0 {
|
||||
scrollView.scrollTo(user.messageList.last!.messageId)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue