mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #1351 from RCGV1/read-indicator-improvements
Remove redundant gotFirstUnreadMessage
This commit is contained in:
commit
fa45e8026f
2 changed files with 0 additions and 7 deletions
|
|
@ -23,7 +23,6 @@ struct ChannelMessageList: View {
|
|||
// Scroll state
|
||||
@State private var showScrollToBottomButton = false
|
||||
@State private var hasReachedBottom = false
|
||||
@State private var gotFirstUnreadMessage: Bool = false
|
||||
|
||||
@State private var messageToHighlight: Int64 = 0
|
||||
|
||||
|
|
@ -164,7 +163,6 @@ struct ChannelMessageList: View {
|
|||
.frame(maxWidth: .infinity)
|
||||
.id(message.messageId)
|
||||
.onAppear {
|
||||
if gotFirstUnreadMessage {
|
||||
if !message.read {
|
||||
message.read = true
|
||||
do {
|
||||
|
|
@ -184,7 +182,6 @@ struct ChannelMessageList: View {
|
|||
hasReachedBottom = true
|
||||
showScrollToBottomButton = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Invisible spacer to detect reaching bottom
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ struct UserMessageList: View {
|
|||
// Scroll state
|
||||
@State private var showScrollToBottomButton = false
|
||||
@State private var hasReachedBottom = false
|
||||
@State private var gotFirstUnreadMessage: Bool = false
|
||||
@State private var messageToHighlight: Int64 = 0
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -132,7 +131,6 @@ struct UserMessageList: View {
|
|||
.frame(maxWidth: .infinity)
|
||||
.id(message.messageId)
|
||||
.onAppear {
|
||||
if gotFirstUnreadMessage {
|
||||
if !message.read {
|
||||
message.read = true
|
||||
do {
|
||||
|
|
@ -151,7 +149,6 @@ struct UserMessageList: View {
|
|||
hasReachedBottom = true
|
||||
showScrollToBottomButton = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -180,7 +177,6 @@ struct UserMessageList: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
gotFirstUnreadMessage = true
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidShowNotification)) { _ in
|
||||
withAnimation {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue