mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-13 07:57:26 +01:00
Prettier run
This commit is contained in:
@@ -296,8 +296,8 @@ export default class Explorer {
|
|||||||
const detectVSCode = () => {
|
const detectVSCode = () => {
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
// Create hidden iframe to detect protocol handler
|
// Create hidden iframe to detect protocol handler
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement("iframe");
|
||||||
iframe.style.display = 'none';
|
iframe.style.display = "none";
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
|
|
||||||
// Set timeout to handle case where protocol isn't supported
|
// Set timeout to handle case where protocol isn't supported
|
||||||
@@ -313,15 +313,19 @@ export default class Explorer {
|
|||||||
// Try to navigate to VS Code protocol
|
// Try to navigate to VS Code protocol
|
||||||
try {
|
try {
|
||||||
// Listen for blur event which might indicate app was launched
|
// Listen for blur event which might indicate app was launched
|
||||||
window.addEventListener('blur', function onBlur() {
|
window.addEventListener(
|
||||||
|
"blur",
|
||||||
|
function onBlur() {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
window.removeEventListener('blur', onBlur);
|
window.removeEventListener("blur", onBlur);
|
||||||
if (document.body.contains(iframe)) {
|
if (document.body.contains(iframe)) {
|
||||||
document.body.removeChild(iframe);
|
document.body.removeChild(iframe);
|
||||||
}
|
}
|
||||||
// Window lost focus, likely because VS Code opened
|
// Window lost focus, likely because VS Code opened
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}, { once: true });
|
},
|
||||||
|
{ once: true },
|
||||||
|
);
|
||||||
|
|
||||||
// Navigate iframe to the VSCode URL
|
// Navigate iframe to the VSCode URL
|
||||||
iframe.src = vscodeUrl;
|
iframe.src = vscodeUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user