diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-09 12:06:32 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-09 12:06:32 +0200 |
commit | e6bc3e21121bc00796d9587aeb8c6b0101e39fa3 (patch) | |
tree | 6c445974363c56fa3713d0c0d0ac9aa42106a023 | |
parent | dd2724904111a1e82bbbba3db8b538405a213b20 (diff) |
Call paginator total pages setter once
-rw-r--r-- | pkg/ui/views/play.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/ui/views/play.go b/pkg/ui/views/play.go index 796813c..89754f9 100644 --- a/pkg/ui/views/play.go +++ b/pkg/ui/views/play.go @@ -157,8 +157,6 @@ func (m PlayModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, exit } - m.paginator.SetTotalPages(len(m.games)) - select { case <-start: return m, SwitchModelCmd(NewGameModel(m.width, m.height+1, m.game, m.network)) @@ -286,6 +284,7 @@ func (m *PlayModel) handleGamesResponse(msg []database.Game) (tea.Model, tea.Cmd m.isLoading = false m.games = msg m.err = nil + m.paginator.SetTotalPages(len(m.games)) return m, nil } |