1
0
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:
Thomas Rittson
2021-10-15 08:59:43 +10:00
committed by GitHub
parent 356262975c
commit 98bd41d4b1
17 changed files with 50 additions and 81 deletions

View File

@@ -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();
}
});
}