mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-22 16:24:33 +01:00
Added error message to VS Code timeout and redirect
This commit is contained in:
parent
ddcc5820e6
commit
7240c9eec1
@ -284,7 +284,7 @@ export default class Explorer {
|
|||||||
|
|
||||||
public openInVsCode(): void {
|
public openInVsCode(): void {
|
||||||
const activeTab = useTabs.getState().activeTab;
|
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
|
const vscodeUrl = activeTab
|
||||||
? `${baseUrl}&database=${activeTab.collection.databaseId}&container=${activeTab.collection?.id()}`
|
? `${baseUrl}&database=${activeTab.collection.databaseId}&container=${activeTab.collection?.id()}`
|
||||||
: baseUrl;
|
: baseUrl;
|
||||||
@ -292,8 +292,12 @@ 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);
|
||||||
const myTimeout = setTimeout((linkOpened.location = "https://code.visualstudio.com/download"), 500);
|
const vsCodeTimeout = setTimeout(
|
||||||
clearTimeout(myTimeout);
|
(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<void> {
|
public async openCESCVAFeedbackBlade(): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user