mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
use tabsQuery on tabsQueryFirst
This commit is contained in:
@@ -820,17 +820,13 @@ export default class MainBackground {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private tabsQueryFirst(options: any): Promise<any> {
|
private async tabsQueryFirst(options: any): Promise<any> {
|
||||||
return new Promise((resolve) => {
|
const tabs = await this.tabsQuery(options);
|
||||||
chrome.tabs.query(options, (tabs: any[]) => {
|
|
||||||
if (tabs.length > 0) {
|
if (tabs.length > 0) {
|
||||||
resolve(tabs[0]);
|
return tabs[0];
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(null);
|
return null;
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private actionSetIcon(theAction: any, suffix: string): Promise<any> {
|
private actionSetIcon(theAction: any, suffix: string): Promise<any> {
|
||||||
|
|||||||
Reference in New Issue
Block a user