mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +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:
@@ -5,6 +5,8 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
@@ -29,12 +31,9 @@ export class ShareComponent extends BaseShareComponent {
|
||||
this.onSharedCipher.subscribe(() => {
|
||||
this.router.navigate(['view-cipher', { cipherId: this.cipherId }]);
|
||||
});
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async params => {
|
||||
this.route.queryParams.pipe(first()).subscribe(async params => {
|
||||
this.cipherId = params.cipherId;
|
||||
await this.load();
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user