diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-02-02 19:28:11 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-02-02 19:28:11 +0200 |
| commit | 822347c1aa9c49b5b1f18dd5913387a382a95e82 (patch) | |
| tree | c5bbd649a093256a215e08d9dfc2550752828b0a | |
| parent | c77ac77e78268bc2f4265a872b213d4300b3eb66 (diff) | |
Moved client-side calculations of notification to after all the
components have updated instead of before so the view will reflect the
update in case any of the updates change the notifications
| -rw-r--r-- | internal/client/ui/core/core.go | 4 | ||||
| -rw-r--r-- | internal/client/ui/core/state/state.go | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index c7b3ca4..eb07593 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -562,8 +562,6 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { return cmd } - calculateNotifications() - var cmds []tea.Cmd var cmd tea.Cmd @@ -592,6 +590,8 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { m.chat, cmd = m.chat.Update(msg) cmds = append(cmds, cmd) + calculateNotifications() + return tea.Batch(cmds...) } diff --git a/internal/client/ui/core/state/state.go b/internal/client/ui/core/state/state.go index ba9e233..b83d542 100644 --- a/internal/client/ui/core/state/state.go +++ b/internal/client/ui/core/state/state.go @@ -3,7 +3,6 @@ package state import ( "crypto/ed25519" "encoding/json" - "log" "slices" "github.com/google/btree" |
