mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[Refactor] Use rxjs first instead of unsubscribe from queryParams (#1229)
* Use rxjs first instead of unsubscribe * Use rxjs first instead of unsubscribe * Update jslib * Update jslib * Downgrade jslib to before breaking changes
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||
@@ -37,7 +39,7 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
if (qParams.identifier != null) {
|
||||
this.identifier = qParams.identifier;
|
||||
} else {
|
||||
@@ -46,9 +48,6 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
this.identifier = storedIdentifier;
|
||||
}
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user