Skip to content

Commit 35915f2

Browse files
committed
Fix refresh of VIEWS view after applying configuration
Add missing await call when calling onCustomizationClick() when handling the customization click button. Waiting ensures that the method updateAvailableViews() method to refresh the view is called after the customization is applied. Fixes #364 Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
1 parent 9e3bf0a commit 35915f2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

local-libs/traceviewer-libs/react-components/src/trace-explorer/trace-explorer-views-widget.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface ReactAvailableViewsProps {
1717
title: string;
1818
tspClientProvider: ITspClientProvider;
1919
contextMenuRenderer?: (event: React.MouseEvent<HTMLDivElement>, output: OutputDescriptor) => void;
20-
onCustomizationClick?: (entry: OutputDescriptor, experiment: Experiment) => void;
20+
onCustomizationClick?: (entry: OutputDescriptor, experiment: Experiment) => Promise<void>;
2121
}
2222

2323
export interface ReactAvailableViewsState {
@@ -297,11 +297,11 @@ export class ReactAvailableViewsWidget extends React.Component<ReactAvailableVie
297297
return EnrichedContent;
298298
}
299299

300-
private handleCustomizeClick = async (entry: OutputDescriptor, e: React.MouseEvent) => {
300+
private readonly handleCustomizeClick = async (entry: OutputDescriptor, e: React.MouseEvent) => {
301301
e.stopPropagation();
302302
if (this.props.onCustomizationClick && this._selectedExperiment) {
303-
this.props.onCustomizationClick(entry, this._selectedExperiment);
304-
this.updateAvailableViews();
303+
await this.props.onCustomizationClick(entry, this._selectedExperiment);
304+
await this.updateAvailableViews();
305305
}
306306
};
307307

0 commit comments

Comments
 (0)