1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-30 04:28:19 +02:00

use tabsQuery on tabsQueryFirst

This commit is contained in:
Kyle Spearrin 2017-12-05 23:48:19 -05:00
parent 72ac90157f
commit 9809fc7d75

View File

@ -820,17 +820,13 @@ export default class MainBackground {
});
}
private tabsQueryFirst(options: any): Promise<any> {
return new Promise((resolve) => {
chrome.tabs.query(options, (tabs: any[]) => {
if (tabs.length > 0) {
resolve(tabs[0]);
return;
}
private async tabsQueryFirst(options: any): Promise<any> {
const tabs = await this.tabsQuery(options);
if (tabs.length > 0) {
return tabs[0];
}
resolve(null);
});
});
return null;
}
private actionSetIcon(theAction: any, suffix: string): Promise<any> {