1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

Centralized BrowserAPI call to refresh firefox

This commit is contained in:
Matt Smith 2020-08-17 14:49:01 -05:00
parent 1075fedad3
commit 4ea3acf80b
2 changed files with 15 additions and 1 deletions

View File

@ -213,4 +213,15 @@ export class BrowserApi {
return chrome.runtime.reload();
}
}
static reloadOpenWindows() {
if(!BrowserApi.isSafariApi)
{
var sidebarName : string = 'sidebar';
var sidebarWindows = chrome.extension.getViews({ type: sidebarName });
if(sidebarWindows && sidebarWindows.length > 0) {
sidebarWindows[0].location.reload();
}
}
}
}

View File

@ -7,7 +7,6 @@ import {
import { ApiService } from 'jslib/abstractions/api.service';
import { AuthService } from 'jslib/abstractions/auth.service';
import BrowserPlatformUtilsService from '../../services/browserPlatformUtils.service';
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
@ -18,6 +17,7 @@ import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service';
import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component';
import { BrowserApi } from '../../browser/browserApi';
@Component({
selector: 'app-sso',
@ -42,6 +42,9 @@ export class SsoComponent extends BaseSsoComponent {
this.clientId = 'browser';
super.onSuccessfulLogin = () => {
BrowserApi.reloadOpenWindows();
const thisWindow = window.open('', '_self');
thisWindow.close();
return syncService.fullSync(true);
};
}