From 6ffa7eedabc15040e1f25897b8cb163c31dd7cc3 Mon Sep 17 00:00:00 2001 From: Marco Mura Date: Wed, 19 Feb 2025 10:30:30 -0800 Subject: [PATCH] Fixed 'Start work' not working if another Start work tab is open --- src/react/atlascode/startwork/startWorkController.ts | 2 +- src/webview/singleViewFactory.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/react/atlascode/startwork/startWorkController.ts b/src/react/atlascode/startwork/startWorkController.ts index 608fef52..d206a369 100644 --- a/src/react/atlascode/startwork/startWorkController.ts +++ b/src/react/atlascode/startwork/startWorkController.ts @@ -75,7 +75,7 @@ export type StartWorkChanges = { [key: string]: any }; function reducer(state: StartWorkState, action: StartWorkUIAction): StartWorkState { switch (action.type) { case StartWorkUIActionType.Init: { - console.log(`JS-1324 start work controller init repo count: ${action.data.repoData.length}`); + console.log(`JS-1324 start work controller init repo count: ${action.data.repoData?.length}`); const newstate = { ...state, ...action.data, diff --git a/src/webview/singleViewFactory.ts b/src/webview/singleViewFactory.ts index 73919167..c019bbea 100644 --- a/src/webview/singleViewFactory.ts +++ b/src/webview/singleViewFactory.ts @@ -119,15 +119,17 @@ export class SingleWebview implements ReactWebview { const { id, site, product } = this._controller.screenDetails(); this._analyticsApi.fireViewScreenEvent(id, site, product); } else { + if (this._controller) { + this._controller.update(factoryData); + this._panel.title = this._controller.title(); + } + this._panel.webview.html = this._controllerFactory.webviewHtml( this._extensionPath, this._panel.webview.asWebviewUri(Uri.file(this._extensionPath)), this._panel.webview.cspSource, ); this._panel.reveal(column ? column : ViewColumn.Active); // , false); - if (this._controller) { - this._controller.update(factoryData); - } } // Send feature gates to the panel in a message