mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
fix #74321 (revert back from async/await due to minifier issues)
This commit is contained in:
parent
31777858c7
commit
b60faaa149
|
@ -314,21 +314,24 @@ export class ElectronWindow extends Disposable {
|
|||
this.integrityService.isPure().then(res => this.titleService.updateProperties({ isPure: res.isPure }));
|
||||
|
||||
// Root warning
|
||||
this.lifecycleService.when(LifecyclePhase.Restored).then(async () => {
|
||||
let isAdmin: boolean;
|
||||
this.lifecycleService.when(LifecyclePhase.Restored).then(() => {
|
||||
let isAdminPromise: Promise<boolean>;
|
||||
if (isWindows) {
|
||||
isAdmin = (await import('native-is-elevated'))();
|
||||
isAdminPromise = import('native-is-elevated').then(isElevated => isElevated()); // not using async here due to https://github.com/microsoft/vscode/issues/74321
|
||||
} else {
|
||||
isAdmin = isRootUser();
|
||||
isAdminPromise = Promise.resolve(isRootUser());
|
||||
}
|
||||
|
||||
// Update title
|
||||
this.titleService.updateProperties({ isAdmin });
|
||||
return isAdminPromise.then(isAdmin => {
|
||||
|
||||
// Show warning message (unix only)
|
||||
if (isAdmin && !isWindows) {
|
||||
this.notificationService.warn(nls.localize('runningAsRoot', "It is not recommended to run {0} as root user.", product.nameShort));
|
||||
}
|
||||
// Update title
|
||||
this.titleService.updateProperties({ isAdmin });
|
||||
|
||||
// Show warning message (unix only)
|
||||
if (isAdmin && !isWindows) {
|
||||
this.notificationService.warn(nls.localize('runningAsRoot', "It is not recommended to run {0} as root user.", product.nameShort));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Touchbar menu (if enabled)
|
||||
|
|
Loading…
Reference in a new issue