From 7240c9eec14bc5fcb709561815d86e453a324aa2 Mon Sep 17 00:00:00 2001 From: "Justin Kolasa (from Dev Box)" Date: Fri, 25 Apr 2025 07:01:14 -0400 Subject: [PATCH] Added error message to VS Code timeout and redirect --- src/Explorer/Explorer.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 200020bb5..fd94f950b 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -284,7 +284,7 @@ export default class Explorer { public openInVsCode(): void { const activeTab = useTabs.getState().activeTab; - const baseUrl = `vscode://ms-azuretools.vscode-cosmosdb?resourceId=${userContext.databaseAccount.id}`; + const baseUrl = `vscod://ms-azuretools.vscode-cosmosdb?resourceId=${userContext.databaseAccount.id}`; const vscodeUrl = activeTab ? `${baseUrl}&database=${activeTab.collection.databaseId}&container=${activeTab.collection?.id()}` : baseUrl; @@ -292,8 +292,12 @@ export default class Explorer { const linkOpened = (navigator.userAgent.includes("insiders") && window.open(vscodeInsidersUrl)) || window.open(vscodeUrl); - const myTimeout = setTimeout((linkOpened.location = "https://code.visualstudio.com/download"), 500); - clearTimeout(myTimeout); + const vsCodeTimeout = setTimeout( + (linkOpened.location = "https://code.visualstudio.com/download"), + 5000, + logConsoleError("Failed to open Visual Studio Code. Please ensure it is installed and try again."), + ); + clearTimeout(vsCodeTimeout); } public async openCESCVAFeedbackBlade(): Promise {