1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

[Refactor] Use rxjs first instead of unsubscribe from queryParams (#2112)

* Use rxjs first instead of unsubscribe

* Update jslib
This commit is contained in:
Thomas Rittson
2021-10-15 07:58:59 +10:00
committed by GitHub
parent 2c2de6a233
commit 82138a08ff
13 changed files with 37 additions and 52 deletions

View File

@@ -9,6 +9,8 @@ import {
Router,
} from '@angular/router';
import { first } from 'rxjs/operators';
import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType';
import { ApiService } from 'jslib-common/abstractions/api.service';
@@ -89,7 +91,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
}
}
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
this.route.queryParams.pipe(first()).subscribe(async qParams => {
if (qParams.sso === 'true') {
super.onSuccessfulLogin = () => {
BrowserApi.reloadOpenWindows();
@@ -97,9 +99,6 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
thisWindow.close();
return this.syncService.fullSync(true);
};
if (queryParamsSub != null) {
queryParamsSub.unsubscribe();
}
}
});
}