From 121051136ea7890e5fffbb16fbfbb2e5268915de Mon Sep 17 00:00:00 2001 From: "Justin Kolasa (from Dev Box)" Date: Thu, 24 Apr 2025 12:49:13 -0400 Subject: [PATCH] Check if VS Code was opened, if not popup with download button link --- src/Explorer/Explorer.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 87e6c901b..157e2a07b 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -297,10 +297,23 @@ export default class Explorer { try { const linkOpened = (navigator.userAgent.includes("Insiders") && window.open(vscodeInsidersUrl)) || window.open(vscodeUrl); - - if (!linkOpened || !linkOpened.closed || typeof !linkOpened.closed === "undefined") { - logConsoleError("Visual Studio Code is not installed on this device"); - window.open("https://code.visualstudio.com/download", "_blank"); + + if (!linkOpened.closed || typeof linkOpened.closed === "undefined") { + linkOpened.close(); + useDialog.getState().openDialog({ + isModal: true, + title: "Visual Studio Code Not Installed", + subText: "It appears Visual Studio Code is not installed on this device. Would you like to download it?", + primaryButtonText: "Download", + secondaryButtonText: "Cancel", + onPrimaryButtonClick: () => { + window.open("https://code.visualstudio.com/download", "_blank"); + useDialog.getState().closeDialog(); + }, + onSecondaryButtonClick: () => { + useDialog.getState().closeDialog(); + }, + }); } TelemetryProcessor.traceSuccess(Action.OpenVSCode, {}, startTime);