From f09bbd0e33e55a901c41a8b93c912ffc282efa4f Mon Sep 17 00:00:00 2001 From: hriday-panchasara Date: Wed, 15 Dec 2021 10:06:34 -0600 Subject: [PATCH] Available views cleared when browser refreshed fixes #599 Signed-off-by: hriday-panchasara --- .../trace-explorer/trace-explorer-opened-traces-widget.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-components/src/trace-explorer/trace-explorer-opened-traces-widget.tsx b/packages/react-components/src/trace-explorer/trace-explorer-opened-traces-widget.tsx index 2941118c4..77a08c5fd 100644 --- a/packages/react-components/src/trace-explorer/trace-explorer-opened-traces-widget.tsx +++ b/packages/react-components/src/trace-explorer/trace-explorer-opened-traces-widget.tsx @@ -51,7 +51,7 @@ export class ReactOpenTracesWidget extends React.Component { this._experimentManager = this.props.tspClientProvider.getExperimentManager(); }); - this.state = { openedExperiments: [], selectedExperimentIndex: 0 }; + this.state = { openedExperiments: [], selectedExperimentIndex: -1 }; } componentDidMount(): void { @@ -267,7 +267,7 @@ export class ReactOpenTracesWidget extends React.Component this._selectedExperiment && experiment.UUID === this._selectedExperiment.UUID); - this.setState({ openedExperiments: remoteExperiments, selectedExperimentIndex: selectedIndex !== -1 ? selectedIndex : 0 }); + this.setState({ openedExperiments: remoteExperiments, selectedExperimentIndex: selectedIndex }); signalManager().fireOpenedTracesChangedSignal(new OpenedTracesUpdatedSignalPayload(remoteExperiments ? remoteExperiments.length : 0)); }