mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-23 06:38:52 +01:00
Fix TUI code that tracked whether a search query is pending so it doesn't show the pending message when no query is pending
This commit is contained in:
parent
8419a883b4
commit
2d2c393bf9
@ -285,8 +285,8 @@ func runQueryAndUpdateTable(m model, forceUpdateTable, maintainCursor bool) tea.
|
||||
if m.runQuery != nil {
|
||||
query = *m.runQuery
|
||||
}
|
||||
LAST_DISPATCHED_QUERY_ID++
|
||||
queryId := LAST_DISPATCHED_QUERY_ID
|
||||
LAST_DISPATCHED_QUERY_ID += 1
|
||||
LAST_DISPATCHED_QUERY_TIMESTAMP = time.Now()
|
||||
return func() tea.Msg {
|
||||
rows, entries, searchErr := getRows(m.ctx, hctx.GetConf(m.ctx).DisplayedColumns, query, PADDED_NUM_ENTRIES)
|
||||
@ -799,8 +799,8 @@ func TuiQuery(ctx context.Context, initialQuery string) error {
|
||||
p := tea.NewProgram(initialModel(ctx, initialQuery), tea.WithOutput(os.Stderr))
|
||||
// Async: Get the initial set of rows
|
||||
go func() {
|
||||
queryId := LAST_DISPATCHED_QUERY_ID
|
||||
LAST_DISPATCHED_QUERY_ID++
|
||||
queryId := LAST_DISPATCHED_QUERY_ID
|
||||
LAST_DISPATCHED_QUERY_TIMESTAMP = time.Now()
|
||||
rows, entries, err := getRows(ctx, hctx.GetConf(ctx).DisplayedColumns, initialQuery, PADDED_NUM_ENTRIES)
|
||||
if err == nil || initialQuery == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user