aboutsummaryrefslogtreecommitdiff
path: root/ui/src/frontend/time_selection_panel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/frontend/time_selection_panel.ts')
-rw-r--r--ui/src/frontend/time_selection_panel.ts26
1 files changed, 3 insertions, 23 deletions
diff --git a/ui/src/frontend/time_selection_panel.ts b/ui/src/frontend/time_selection_panel.ts
index 8ec07482d..d5dc9397a 100644
--- a/ui/src/frontend/time_selection_panel.ts
+++ b/ui/src/frontend/time_selection_panel.ts
@@ -129,35 +129,15 @@ export class TimeSelectionPanel extends Panel {
ctx.fillRect(xAndTime[0], 0, 1, size.height);
}
- const localArea = globals.frontendLocalState.selectedArea;
- const selection = globals.state.currentSelection;
- if (localArea !== undefined) {
- const start = Math.min(localArea.startSec, localArea.endSec);
- const end = Math.max(localArea.startSec, localArea.endSec);
- this.renderSpan(ctx, size, new TimeSpan(start, end));
- } else if (selection !== null && selection.kind === 'AREA') {
- const selectedArea = globals.state.areas[selection.areaId];
+ const selectedArea = globals.frontendLocalState.selectedArea.area;
+ if (selectedArea !== undefined) {
const start = Math.min(selectedArea.startSec, selectedArea.endSec);
const end = Math.max(selectedArea.startSec, selectedArea.endSec);
this.renderSpan(ctx, size, new TimeSpan(start, end));
- }
-
- if (globals.frontendLocalState.hoveredLogsTimestamp !== -1) {
+ } else if (globals.frontendLocalState.hoveredLogsTimestamp !== -1) {
this.renderHover(
ctx, size, globals.frontendLocalState.hoveredLogsTimestamp);
}
-
- for (const note of Object.values(globals.state.notes)) {
- const noteIsSelected = selection !== null && selection.kind === 'AREA' &&
- selection.noteId === note.id;
- if (note.noteType === 'AREA' && !noteIsSelected) {
- const selectedArea = globals.state.areas[note.areaId];
- this.renderSpan(
- ctx,
- size,
- new TimeSpan(selectedArea.startSec, selectedArea.endSec));
- }
- }
}
renderHover(ctx: CanvasRenderingContext2D, size: PanelSize, ts: number) {