Skip to content

Commit

Permalink
Don't handle TraceWidgetActivatedSignal for the selected experiment
Browse files Browse the repository at this point in the history
This avoids unnecessary processing and broadcasting of signals if the
experiment is already selected.

Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Oct 19, 2021
1 parent 4a5201f commit d0ec5c5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ export class ReactOpenTracesWidget extends React.Component<ReactOpenTracesWidget
}

protected doHandleTracesWidgetActivatedSignal(experiment: Experiment): void {
this._selectedExperiment = experiment;
const selectedIndex = this.state.openedExperiments.findIndex(openedExperiment => openedExperiment.UUID === experiment.UUID);
this.selectExperiment(selectedIndex);
if (this._selectedExperiment?.UUID !== experiment.UUID) {
this._selectedExperiment = experiment;
const selectedIndex = this.state.openedExperiments.findIndex(openedExperiment => openedExperiment.UUID === experiment.UUID);
this.selectExperiment(selectedIndex);
}
}

protected doHandleContextMenuEvent(event: React.MouseEvent<HTMLDivElement>, traceUUID: string): void {
Expand Down

0 comments on commit d0ec5c5

Please sign in to comment.