mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-18 14:24:15 +01:00
Check if VS Code was opened, if not popup with download button link
This commit is contained in:
parent
ea8d96528f
commit
121051136e
@ -297,10 +297,23 @@ export default class Explorer {
|
|||||||
try {
|
try {
|
||||||
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();
|
||||||
window.open("https://code.visualstudio.com/download", "_blank");
|
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);
|
TelemetryProcessor.traceSuccess(Action.OpenVSCode, {}, startTime);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user