Skip to content

Commit 05db6db

Browse files
fix: truncate watchlist rows on group change
1 parent 73e0f17 commit 05db6db

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/ui/component/watchlist/watchlist.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ func (m *Model) Update(msg tea.Msg) (*Model, tea.Cmd) {
9494
}
9595
}
9696

97+
if len(assets) < len(m.rows) {
98+
m.rows = m.rows[:len(assets)]
99+
}
100+
97101
m.assets = assets
98102
m.assetsBySymbol = assetsBySymbol
99103

internal/ui/ui.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
154154
return m, tea.Quit
155155
case "up":
156156
m.viewport, cmd = m.viewport.Update(msg)
157+
157158
return m, cmd
158159
case "down":
159160
m.viewport, cmd = m.viewport.Update(msg)
161+
160162
return m, cmd
161163

162164
}

0 commit comments

Comments
 (0)