mirror of
https://github.com/bitwarden/browser
synced 2024-12-28 02:43:04 +01:00
Centralized BrowserAPI call to refresh firefox
This commit is contained in:
parent
1075fedad3
commit
4ea3acf80b
@ -213,4 +213,15 @@ export class BrowserApi {
|
|||||||
return chrome.runtime.reload();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
|
|
||||||
import { ApiService } from 'jslib/abstractions/api.service';
|
import { ApiService } from 'jslib/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib/abstractions/auth.service';
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
||||||
import BrowserPlatformUtilsService from '../../services/browserPlatformUtils.service';
|
|
||||||
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
||||||
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.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 { SyncService } from 'jslib/abstractions/sync.service';
|
||||||
|
|
||||||
import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component';
|
import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component';
|
||||||
|
import { BrowserApi } from '../../browser/browserApi';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sso',
|
selector: 'app-sso',
|
||||||
@ -42,6 +42,9 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
this.clientId = 'browser';
|
this.clientId = 'browser';
|
||||||
|
|
||||||
super.onSuccessfulLogin = () => {
|
super.onSuccessfulLogin = () => {
|
||||||
|
BrowserApi.reloadOpenWindows();
|
||||||
|
const thisWindow = window.open('', '_self');
|
||||||
|
thisWindow.close();
|
||||||
return syncService.fullSync(true);
|
return syncService.fullSync(true);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user