Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
isViewOpen returns promise
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Aug 20, 2019
1 parent 1f98a2e commit ae37c21
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/abstractions/platformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export abstract class PlatformUtilsService {
isIE: () => boolean;
isMacAppStore: () => boolean;
analyticsId: () => string;
isViewOpen: () => boolean;
isViewOpen: () => Promise<boolean>;
lockTimeout: () => number;
launchUri: (uri: string, options?: any) => void;
saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/services/cliPlatformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class CliPlatformUtilsService implements PlatformUtilsService {
}

isViewOpen() {
return false;
return Promise.resolve(false);
}

lockTimeout(): number {
Expand Down
4 changes: 2 additions & 2 deletions src/electron/services/electronPlatformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
return this.analyticsIdCache;
}

isViewOpen(): boolean {
return false;
isViewOpen(): Promise<boolean> {
return Promise.resolve(false);
}

lockTimeout(): number {
Expand Down
2 changes: 1 addition & 1 deletion src/services/lock.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class LockService implements LockServiceAbstraction {
}

async checkLock(): Promise<void> {
if (this.platformUtilsService.isViewOpen()) {
if (await this.platformUtilsService.isViewOpen()) {
// Do not lock
return;
}
Expand Down

0 comments on commit ae37c21

Please sign in to comment.