mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from master
This commit is contained in:
@@ -3,16 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { mapEvent, fromNodeEventEmitter, filterEvent, once } from 'vs/base/common/event';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import product from 'vs/platform/node/product';
|
||||
import { app } from 'electron';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows';
|
||||
import { ReadyState } from 'vs/platform/windows/common/windows';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
|
||||
function uriFromRawUrl(url: string): URI | null {
|
||||
try {
|
||||
@@ -38,9 +36,15 @@ export class ElectronURLListener {
|
||||
];
|
||||
|
||||
const buffer = rawBuffer.map(uriFromRawUrl).filter(uri => !!uri);
|
||||
const flush = () => buffer.forEach(uri => urlService.open(uri));
|
||||
const flush = () => buffer.forEach(uri => {
|
||||
if (uri) {
|
||||
urlService.open(uri);
|
||||
}
|
||||
});
|
||||
|
||||
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url', '--']);
|
||||
if (isWindows) {
|
||||
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url', '--']);
|
||||
}
|
||||
|
||||
const onOpenElectronUrl = mapEvent(
|
||||
fromNodeEventEmitter(app, 'open-url', (event: Electron.Event, url: string) => ({ event, url })),
|
||||
@@ -54,7 +58,7 @@ export class ElectronURLListener {
|
||||
onOpenUrl(this.urlService.open, this.urlService, this.disposables);
|
||||
|
||||
const isWindowReady = windowsService.getWindows()
|
||||
.filter(w => w.readyState === ReadyState.READY)
|
||||
.filter(w => w.isReady)
|
||||
.length > 0;
|
||||
|
||||
if (isWindowReady) {
|
||||
|
||||
Reference in New Issue
Block a user