mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +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:
@@ -12,6 +12,8 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { CipherType } from 'jslib-common/enums/cipherType';
|
||||
|
||||
import { CipherView } from 'jslib-common/models/view/cipherView';
|
||||
@@ -81,7 +83,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
|
||||
);
|
||||
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async params => {
|
||||
this.route.queryParams.pipe(first()).subscribe(async params => {
|
||||
await this.syncService.fullSync(false);
|
||||
|
||||
this.showUpdateKey = !(await this.cryptoService.hasEncKey());
|
||||
@@ -139,10 +141,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user