Check if VS Code was opened, if not popup with download button link

This commit is contained in:
Justin Kolasa (from Dev Box) 2025-04-24 12:49:13 -04:00
parent ea8d96528f
commit 121051136e

View File

@ -298,9 +298,22 @@ export default class Explorer {
const linkOpened = const linkOpened =
(navigator.userAgent.includes("Insiders") && window.open(vscodeInsidersUrl)) || window.open(vscodeUrl); (navigator.userAgent.includes("Insiders") && window.open(vscodeInsidersUrl)) || window.open(vscodeUrl);
if (!linkOpened || !linkOpened.closed || typeof !linkOpened.closed === "undefined") { if (!linkOpened.closed || typeof linkOpened.closed === "undefined") {
logConsoleError("Visual Studio Code is not installed on this device"); 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"); window.open("https://code.visualstudio.com/download", "_blank");
useDialog.getState().closeDialog();
},
onSecondaryButtonClick: () => {
useDialog.getState().closeDialog();
},
});
} }
TelemetryProcessor.traceSuccess(Action.OpenVSCode, {}, startTime); TelemetryProcessor.traceSuccess(Action.OpenVSCode, {}, startTime);