Skip to content

Commit

Permalink
Bug-fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
spacez320 committed Feb 9, 2024
1 parent 197d9c3 commit 92c26da
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions internal/lib/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func helpText() string {
return HELP_TEXT + fmt.Sprintf(
"\nQuery: %v | Labels: %v | Filters: %v",
currentCtx.Value("query"),
currentCtx.Value("labels"),
store.GetLabels(currentCtx.Value("query").(string)),
currentCtx.Value("filters"))
}

Expand Down Expand Up @@ -115,13 +115,13 @@ func StreamDisplay(query string) {
reader = readerIndexes[query] // Reader index for the query.
)

// Initialize the display.
resultsView, _, _ := initDisplayTviewText(helpText())

// Wait for the first result to appear to synchronize storage.
GetResultWait(query)
reader.Dec()

// Initialize the display.
resultsView, _, _ := initDisplayTviewText(helpText())

// Start the display.
display(
DISPLAY_TVIEW,
Expand Down Expand Up @@ -163,13 +163,13 @@ func TableDisplay(query string, filters []string) {
valueIndexes = []int{} // Indexes of the result values to add to the table.
)

// Initialize the display.
resultsView, _, _ := initDisplayTviewTable(helpText())

// Wait for the first result to appear to synchronize storage.
GetResultWait(query)
reader.Dec()

// Initialize the display.
resultsView, _, _ := initDisplayTviewTable(helpText())

// Start the display.
display(
DISPLAY_TVIEW,
Expand Down Expand Up @@ -264,6 +264,10 @@ func GraphDisplay(query string, filters []string) {
valueIndex = 0 // Index of the result value to graph.
)

// Wait for the first result to appear to synchronize storage.
GetResultWait(query)
reader.Dec()

// Determine the values to populate into the graph. If none is provided, the first value is taken.
if len(filters) > 0 {
valueIndex = store.GetValueIndex(query, filters[0])
Expand Down

0 comments on commit 92c26da

Please sign in to comment.