1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-07 09:31:31 +01:00

isViewOpen returns promise

This commit is contained in:
Kyle Spearrin 2019-08-20 13:47:22 -04:00
parent 545e92ca2e
commit deb5d2bf62
2 changed files with 6 additions and 7 deletions

2
jslib

@ -1 +1 @@
Subproject commit 1f98a2ebcb1f08dca39047fe77d8dea4bb1a67dc
Subproject commit ae37c2198bd2cb4799f76592c7fa49be154135d3

View File

@ -89,24 +89,23 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
return this.analyticsIdCache;
}
isViewOpen(): boolean {
isViewOpen(): Promise<boolean> {
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 {