diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-05-24 15:09:08 +0300 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-05-24 15:09:08 +0300 |
| commit | 1329a9858487c2e95ea7191c2b7808b7533c20d3 (patch) | |
| tree | d7cf81414f4b1d2d28f24b8092ac22e658d81009 /internal/client/ui/core/core.go | |
| parent | 8aa5cbb72e6ad289582ac8fe687a7bfcc5e49beb (diff) | |
Refactored minor things and added a terminology.md file which will be
expanded later
Diffstat (limited to 'internal/client/ui/core/core.go')
| -rw-r--r-- | internal/client/ui/core/core.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index 5f5fc3c..fd91026 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -723,13 +723,13 @@ func (m *Model) HasPopup() bool { } func calculateNotifications() { - for _, signal := range state.Data.Signals { - if _, ok := state.State.Messages[signal]; !ok { + for _, signalId := range state.Data.Signals { + if _, ok := state.State.Messages[signalId]; !ok { continue } - pings := getSignalNotification(signal) - state.State.LocalNotifications[signal] = pings + pings := getSignalNotification(signalId) + state.State.LocalNotifications[signalId] = pings } for networkId := range state.State.Networks { @@ -779,7 +779,8 @@ func getFrequencyNotification(networkId, frequencyId snowflake.ID) (_ int, _ boo pings++ } - return pings <= 10 + // No need to continue if we have 10 pings + return pings < 10 }) return pings, hasNotif @@ -800,7 +801,9 @@ func getSignalNotification(signal snowflake.ID) int { btree.AscendGreaterOrEqual(data.Message{ID: *lastReadMsg + 1}, func(item data.Message) bool { pings++ - return pings <= 10 + + // No need to continue if we have 10 pings + return pings < 10 }) return pings |
