Skip to content

Commit

Permalink
fix g
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbyz committed Jan 2, 2024
1 parent d117555 commit 442e1ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ coverage.out
*.swo

wallets.json

log.txt
15 changes: 2 additions & 13 deletions cmd/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ func renderMonitorUI(ctx context.Context, ec *ethclient.Client, ms *monitorStatu

redraw(ms)

previousKey := ""
for {
forceRedraw := false
select {
Expand Down Expand Up @@ -562,17 +561,13 @@ func renderMonitorUI(ctx context.Context, ec *ethclient.Client, ms *monitorStatu
blockTable.SelectedRow = 1
setBlock = true
case "g":
if previousKey == "g" {
ms.TopDisplayedBlock = ms.HeadBlock
blockTable.SelectedRow = 1
setBlock = true
}
blockTable.SelectedRow = 1
setBlock = true
case "G", "<End>":
if len(renderedBlocks) < windowSize {
ms.TopDisplayedBlock = ms.HeadBlock
blockTable.SelectedRow = len(renderedBlocks)
} else {
// windowOffset = len(allBlocks) - windowSize
blockTable.SelectedRow = max(windowSize, len(renderedBlocks))
}
setBlock = true
Expand Down Expand Up @@ -641,12 +636,6 @@ func renderMonitorUI(ctx context.Context, ec *ethclient.Client, ms *monitorStatu
log.Trace().Str("id", e.ID).Msg("Unknown ui event")
}

if previousKey == "g" {
previousKey = ""
} else {
previousKey = e.ID
}

if !forceRedraw {
redraw(ms)
}
Expand Down

0 comments on commit 442e1ba

Please sign in to comment.