Skip to content

Commit 32b114b

Browse files
authored
fix(ui): redraw logs on wrong filter only when filter is on (#10)
1 parent 8bb1e93 commit 32b114b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ui/input_filter.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ func handleFilterInput(key tcell.Key) {
2121
if err != nil {
2222
ShowError(err)
2323

24-
// There was an error with the new filter string
25-
// lets try to use the old one to populate the screen.
26-
// We gonna ignore any more errors though.
27-
logsView.Clear()
28-
store.Filter(filter)
24+
// There was an error in filter string
25+
// But redraw the screen only if filter is actually turned on
26+
if isFilterOn {
27+
logsView.Clear()
28+
store.Filter(filter)
29+
}
30+
31+
// Lets revert the filter to previous one
2932
filterInput.SetText(filter)
3033
layout.RemoveItem(filterInput)
3134
return

0 commit comments

Comments
 (0)