Skip to content

Commit

Permalink
fix panic in gui, bump to v1.10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Sep 19, 2024
1 parent 7c74e5f commit 17154c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.10.6

* Fixed `substreams gui` panic (regression appeared in v1.10.3)

## v1.10.5

* Fixed an(other) issue where multiple stores running on the same stage with different initialBlocks will fail to proress (and hang)
Expand Down
6 changes: 5 additions & 1 deletion tui2/components/blockselect/blockselect.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ func (b *BlockSelect) View() string {
}

var activeBlock string
ptr := int(float64(b.activeBlock-b.lowBlock) / binSize)
var ptr int
if b.activeBlock > 0 { // avoid division by zero
ptr = int(float64(b.activeBlock-b.lowBlock) / binSize)
}
activeBlock = fmt.Sprintf("%s: %s",
styles.BlockSelect.CurrentBlock.Render("Current block"),
styles.BlockSelect.SelectedBlock.Render(humanize.Comma(int64(b.activeBlock))),
Expand All @@ -134,6 +137,7 @@ func (b *BlockSelect) View() string {
if repeatLen < 0 {
repeatLen = 0
}

activeBlock = fmt.Sprintf("%s%s ^",
strings.Repeat(" ", repeatLen),
activeBlock,
Expand Down

0 comments on commit 17154c1

Please sign in to comment.