mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-01 18:08:19 +01:00
Close loginTab after login was done by user
This commit is contained in:
parent
f56a9146be
commit
89344a7c36
@ -77,6 +77,8 @@ export default class RuntimeBackground {
|
||||
if (this.lockedVaultPendingNotifications.length > 0) {
|
||||
const retryItem = this.lockedVaultPendingNotifications.pop();
|
||||
await this.processMessage(retryItem.msg, retryItem.sender, null);
|
||||
|
||||
await BrowserApi.closeLoginTab();
|
||||
}
|
||||
break;
|
||||
case 'addToLockedVaultPendingNotifications':
|
||||
|
@ -97,6 +97,20 @@ export class BrowserApi {
|
||||
});
|
||||
}
|
||||
|
||||
static async closeLoginTab() {
|
||||
const tabs = await BrowserApi.tabsQuery({
|
||||
active: true,
|
||||
title: 'Bitwarden',
|
||||
});
|
||||
|
||||
if (tabs.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const tabToClose = tabs[tabs.length - 1].id;
|
||||
chrome.tabs.remove(tabToClose);
|
||||
}
|
||||
|
||||
static closePopup(win: Window) {
|
||||
if (BrowserApi.isWebExtensionsApi && BrowserApi.isFirefoxOnAndroid) {
|
||||
// Reactivating the active tab dismisses the popup tab. The promise final
|
||||
|
Loading…
Reference in New Issue
Block a user