From e3e70b7cdb0d97b32aca5f78e3db9f020e94ac03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Budrevi=C4=8Dius?= Date: Tue, 31 Dec 2024 12:15:31 +0200 Subject: [PATCH] pr fix --- .../appui-react/frontstage/FrontstageDef.tsx | 17 +++++++---------- .../appui-react/widget-panels/ToolSettings.tsx | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/appui-react/src/appui-react/frontstage/FrontstageDef.tsx b/ui/appui-react/src/appui-react/frontstage/FrontstageDef.tsx index bd3038c8be0..fb780cf4d81 100644 --- a/ui/appui-react/src/appui-react/frontstage/FrontstageDef.tsx +++ b/ui/appui-react/src/appui-react/frontstage/FrontstageDef.tsx @@ -75,9 +75,8 @@ export class FrontstageDef { private _isApplicationClosing = false; private _usage?: string; private _version: number = 0; - private _toolSettings?: WidgetDef & { - activeToolEmptyNode?: React.ReactNode; - }; + private _toolSettings?: WidgetDef; + private _activeToolEmptyNode?: React.ReactNode; private _statusBar?: WidgetDef; private _contentManipulation?: WidgetDef; private _viewNavigation?: WidgetDef; @@ -115,11 +114,12 @@ export class FrontstageDef { return this._floatingContentControls; } - public get toolSettings(): - | (WidgetDef & { activeToolEmptyNode?: React.ReactNode }) - | undefined { + public get toolSettings(): WidgetDef | undefined { return this._toolSettings; } + public get activeToolEmptyNode(): React.ReactNode | undefined { + return this._activeToolEmptyNode; + } public get statusBar(): WidgetDef | undefined { return this._statusBar; } @@ -584,10 +584,7 @@ export class FrontstageDef { config.toolSettings, WidgetType.ToolSettings ); - if (this._toolSettings) { - this._toolSettings.activeToolEmptyNode = - config.toolSettings?.activeToolEmptyNode; - } + this._activeToolEmptyNode = config.toolSettings?.activeToolEmptyNode; this._statusBar = createWidgetDef(config.statusBar, WidgetType.StatusBar); this._contentManipulation = createWidgetDef( config.contentManipulation, diff --git a/ui/appui-react/src/appui-react/widget-panels/ToolSettings.tsx b/ui/appui-react/src/appui-react/widget-panels/ToolSettings.tsx index c6653068221..1e177e7b23f 100644 --- a/ui/appui-react/src/appui-react/widget-panels/ToolSettings.tsx +++ b/ui/appui-react/src/appui-react/widget-panels/ToolSettings.tsx @@ -72,7 +72,7 @@ export function ToolSettingsDockedContent() { () => [ { editorNode: null, - labelNode: frontstageDef?.toolSettings?.activeToolEmptyNode ?? ( + labelNode: frontstageDef?.activeToolEmptyNode ?? ( ), }, @@ -189,7 +189,7 @@ export function ToolSettingsWidgetContent() { key={forceRefreshKey} > - {node ?? frontstageDef?.toolSettings?.activeToolEmptyNode ?? ( + {node ?? frontstageDef?.activeToolEmptyNode ?? ( )}