From deb5d2bf62be5790bf86e81e14bea3dcb57eed95 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 20 Aug 2019 13:47:22 -0400 Subject: [PATCH] isViewOpen returns promise --- jslib | 2 +- src/services/browserPlatformUtils.service.ts | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/jslib b/jslib index 1f98a2ebcb..ae37c2198b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 1f98a2ebcb1f08dca39047fe77d8dea4bb1a67dc +Subproject commit ae37c2198bd2cb4799f76592c7fa49be154135d3 diff --git a/src/services/browserPlatformUtils.service.ts b/src/services/browserPlatformUtils.service.ts index b358146205..326fcfc469 100644 --- a/src/services/browserPlatformUtils.service.ts +++ b/src/services/browserPlatformUtils.service.ts @@ -89,24 +89,23 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService return this.analyticsIdCache; } - isViewOpen(): boolean { + isViewOpen(): Promise { if (BrowserApi.isPopupOpen()) { - return true; + return Promise.resolve(true); } if (this.isSafari()) { - // TODO - return false; + return Promise.resolve(false); } const sidebarView = this.sidebarViewName(); const sidebarOpen = sidebarView != null && chrome.extension.getViews({ type: sidebarView }).length > 0; if (sidebarOpen) { - return true; + return Promise.resolve(true); } const tabOpen = chrome.extension.getViews({ type: 'tab' }).length > 0; - return tabOpen; + return Promise.resolve(tabOpen); } lockTimeout(): number {