diff options
| -rw-r--r-- | internal/client/ui/core/chat/chat.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index 9451de7..10c7b99 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -266,16 +266,16 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { } lastMsg := state.GetLastMessage(receiverId) - if m.base == SnapToBottom && lastMsg != nil { + if m.base != SnapToBottom { + m.keepLastRead = false + } else if lastMsg != nil { lastReadMsg := state.Data.LastReadMessage[receiverId] + if m.keepLastRead && m.lastReadMsg != nil && lastReadMsg != nil && + *lastReadMsg != *lastMsg && *lastReadMsg != *m.lastReadMsg { + m.keepLastRead = false + } - // if m.lastReadMsg != nil && lastReadMsg != nil && - // *lastReadMsg != *lastMsg && - // *lastReadMsg != *m.lastReadMsg { - // m.keepLastRead = false - // } - - *lastReadMsg = *lastMsg + state.Data.LastReadMessage[receiverId] = lastMsg } } |
