ui: open ui multiple times to display blank problem fix
After opening the trace, move and click the slice, resulting in a change in |globals.state.frontendLocalState.visibleState|.
When other traces are opened again, other traces will use the previous |globals.state.frontendLocalState.visibleState|, thus displaying a blank interface
Change-Id: I39664dac1ad4f836651615e592d814dded0bb43e
Signed-off-by: Sui <coolsui.coding@gmail.com>
diff --git a/ui/src/controller/trace_controller.ts b/ui/src/controller/trace_controller.ts
index 3530bec..bd5d4d0 100644
--- a/ui/src/controller/trace_controller.ts
+++ b/ui/src/controller/trace_controller.ts
@@ -872,7 +872,9 @@
// if we have non-default visible state, update the visible time to it
const previousVisibleState = globals.state.frontendLocalState.visibleState;
if (!(previousVisibleState.startSec === defaultTraceTime.startSec &&
- previousVisibleState.endSec === defaultTraceTime.endSec)) {
+ previousVisibleState.endSec === defaultTraceTime.endSec) &&
+ (previousVisibleState.startSec >= traceStartSec &&
+ previousVisibleState.endSec <= traceEndSec)) {
return [previousVisibleState.startSec, previousVisibleState.endSec];
}