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:
@@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user