mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +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:
@@ -7,6 +7,8 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
@@ -66,11 +68,8 @@ export class ClientsComponent implements OnInit {
|
|||||||
|
|
||||||
await this.load();
|
await this.load();
|
||||||
|
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.searchText = qParams.search;
|
this.searchText = qParams.search;
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
@@ -81,7 +83,7 @@ export class PeopleComponent extends BasePeopleComponent<ProviderUserUserDetails
|
|||||||
|
|
||||||
await this.load();
|
await this.load();
|
||||||
|
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.searchText = qParams.search;
|
this.searchText = qParams.search;
|
||||||
if (qParams.viewEvents != null) {
|
if (qParams.viewEvents != null) {
|
||||||
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
||||||
@@ -89,9 +91,6 @@ export class PeopleComponent extends BasePeopleComponent<ProviderUserUserDetails
|
|||||||
this.events(user[0]);
|
this.events(user[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
ToasterService,
|
ToasterService,
|
||||||
} from 'angular2-toaster';
|
} from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
|
||||||
@@ -41,12 +43,7 @@ export class SetupComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
document.body.classList.remove('layout_frontend');
|
document.body.classList.remove('layout_frontend');
|
||||||
let fired = false;
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
|
||||||
if (fired) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fired = true;
|
|
||||||
const error = qParams.providerId == null || qParams.email == null || qParams.token == null;
|
const error = qParams.providerId == null || qParams.email == null || qParams.token == null;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
2
jslib
2
jslib
Submodule jslib updated: 56233e4002...a20e935268
@@ -4,6 +4,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||||
@@ -42,7 +44,7 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
||||||
this.email = qParams.email;
|
this.email = qParams.email;
|
||||||
}
|
}
|
||||||
@@ -53,9 +55,6 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
{ route: '/settings/create-organization', qParams: { plan: qParams.org } });
|
{ route: '/settings/create-organization', qParams: { plan: qParams.org } });
|
||||||
}
|
}
|
||||||
await super.ngOnInit();
|
await super.ngOnInit();
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const invite = await this.stateService.get<any>('orgInvitation');
|
const invite = await this.stateService.get<any>('orgInvitation');
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
@@ -44,7 +46,7 @@ export class RegisterComponent extends BaseRegisterComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(qParams => {
|
this.route.queryParams.pipe(first()).subscribe(qParams => {
|
||||||
this.referenceData = new ReferenceEventRequest();
|
this.referenceData = new ReferenceEventRequest();
|
||||||
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
||||||
this.email = qParams.email;
|
this.email = qParams.email;
|
||||||
@@ -68,9 +70,6 @@ export class RegisterComponent extends BaseRegisterComponent {
|
|||||||
if (this.referenceData.id === '') {
|
if (this.referenceData.id === '') {
|
||||||
this.referenceData.id = null;
|
this.referenceData.id = null;
|
||||||
}
|
}
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
const invite = await this.stateService.get<any>('orgInvitation');
|
const invite = await this.stateService.get<any>('orgInvitation');
|
||||||
if (invite != null) {
|
if (invite != null) {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||||
@@ -37,7 +39,7 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
if (qParams.identifier != null) {
|
if (qParams.identifier != null) {
|
||||||
this.identifier = qParams.identifier;
|
this.identifier = qParams.identifier;
|
||||||
} else {
|
} else {
|
||||||
@@ -46,9 +48,6 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
this.identifier = storedIdentifier;
|
this.identifier = storedIdentifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -25,12 +27,7 @@ export class VerifyEmailTokenComponent implements OnInit {
|
|||||||
private apiService: ApiService, private userService: UserService) { }
|
private apiService: ApiService, private userService: UserService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let fired = false;
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
|
||||||
if (fired) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fired = true;
|
|
||||||
if (qParams.userId != null && qParams.token != null) {
|
if (qParams.userId != null && qParams.token != null) {
|
||||||
try {
|
try {
|
||||||
await this.apiService.postAccountVerifyEmailToken(
|
await this.apiService.postAccountVerifyEmailToken(
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -31,12 +33,7 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let fired = false;
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
|
||||||
if (fired) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fired = true;
|
|
||||||
if (qParams.userId != null && qParams.token != null && qParams.email != null) {
|
if (qParams.userId != null && qParams.token != null && qParams.email != null) {
|
||||||
this.userId = qParams.userId;
|
this.userId = qParams.userId;
|
||||||
this.token = qParams.token;
|
this.token = qParams.token;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
ToasterService,
|
ToasterService,
|
||||||
} from 'angular2-toaster';
|
} from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
@@ -35,12 +37,7 @@ export abstract class BaseAcceptComponent implements OnInit {
|
|||||||
abstract unauthedHandler(qParams: any): Promise<void>;
|
abstract unauthedHandler(qParams: any): Promise<void>;
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
let fired = false;
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
|
||||||
if (fired) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fired = true;
|
|
||||||
await this.stateService.remove('loginRedirect');
|
await this.stateService.remove('loginRedirect');
|
||||||
|
|
||||||
let error = this.requiredParameters.some(e => qParams?.[e] == null || qParams[e] === '');
|
let error = this.requiredParameters.some(e => qParams?.[e] == null || qParams[e] === '');
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
@@ -57,11 +59,8 @@ export class CollectionsComponent implements OnInit {
|
|||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
this.organizationId = params.organizationId;
|
this.organizationId = params.organizationId;
|
||||||
await this.load();
|
await this.load();
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.searchText = qParams.search;
|
this.searchText = qParams.search;
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -60,11 +62,8 @@ export class GroupsComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.load();
|
await this.load();
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.searchText = qParams.search;
|
this.searchText = qParams.search;
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import {
|
|||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
Router,
|
Router,
|
||||||
@@ -120,7 +122,7 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
|||||||
|
|
||||||
await this.load();
|
await this.load();
|
||||||
|
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.searchText = qParams.search;
|
this.searchText = qParams.search;
|
||||||
if (qParams.viewEvents != null) {
|
if (qParams.viewEvents != null) {
|
||||||
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
||||||
@@ -128,9 +130,6 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
|||||||
this.events(user[0]);
|
this.events(user[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -58,7 +60,7 @@ export class PoliciesComponent implements OnInit {
|
|||||||
await this.load();
|
await this.load();
|
||||||
|
|
||||||
// Handle policies component launch from Event message
|
// Handle policies component launch from Event message
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
if (qParams.policyId != null) {
|
if (qParams.policyId != null) {
|
||||||
const policyIdFromEvents: string = qParams.policyId;
|
const policyIdFromEvents: string = qParams.policyId;
|
||||||
for (const orgPolicy of this.orgPolicies) {
|
for (const orgPolicy of this.orgPolicies) {
|
||||||
@@ -73,10 +75,6 @@ export class PoliciesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
@@ -65,12 +67,12 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
|
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
|
||||||
);
|
);
|
||||||
|
|
||||||
const queryParams = this.route.parent.params.subscribe(async params => {
|
this.route.parent.params.pipe(first()).subscribe(async params => {
|
||||||
this.organization = await this.userService.getOrganization(params.organizationId);
|
this.organization = await this.userService.getOrganization(params.organizationId);
|
||||||
this.groupingsComponent.organization = this.organization;
|
this.groupingsComponent.organization = this.organization;
|
||||||
this.ciphersComponent.organization = this.organization;
|
this.ciphersComponent.organization = this.organization;
|
||||||
|
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;
|
this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;
|
||||||
if (!this.organization.canViewAllCollections) {
|
if (!this.organization.canViewAllCollections) {
|
||||||
await this.syncService.fullSync(false);
|
await this.syncService.fullSync(false);
|
||||||
@@ -118,15 +120,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
this.viewEvents(cipher[0]);
|
this.viewEvents(cipher[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (queryParams != null) {
|
|
||||||
queryParams.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { PlanType } from 'jslib-common/enums/planType';
|
import { PlanType } from 'jslib-common/enums/planType';
|
||||||
import { ProductType } from 'jslib-common/enums/productType';
|
import { ProductType } from 'jslib-common/enums/productType';
|
||||||
|
|
||||||
@@ -20,7 +22,7 @@ export class CreateOrganizationComponent implements OnInit {
|
|||||||
constructor(private route: ActivatedRoute) { }
|
constructor(private route: ActivatedRoute) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||||
if (qParams.plan === 'families') {
|
if (qParams.plan === 'families') {
|
||||||
this.orgPlansComponent.plan = PlanType.FamiliesAnnually;
|
this.orgPlansComponent.plan = PlanType.FamiliesAnnually;
|
||||||
this.orgPlansComponent.product = ProductType.Families;
|
this.orgPlansComponent.product = ProductType.Families;
|
||||||
@@ -31,9 +33,6 @@ export class CreateOrganizationComponent implements OnInit {
|
|||||||
this.orgPlansComponent.plan = PlanType.EnterpriseAnnually;
|
this.orgPlansComponent.plan = PlanType.EnterpriseAnnually;
|
||||||
this.orgPlansComponent.product = ProductType.Enterprise;
|
this.orgPlansComponent.product = ProductType.Enterprise;
|
||||||
}
|
}
|
||||||
if (queryParamsSub != null) {
|
|
||||||
queryParamsSub.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { first } from 'rxjs/operators';
|
||||||
|
|
||||||
import { CipherType } from 'jslib-common/enums/cipherType';
|
import { CipherType } from 'jslib-common/enums/cipherType';
|
||||||
|
|
||||||
import { CipherView } from 'jslib-common/models/view/cipherView';
|
import { CipherView } from 'jslib-common/models/view/cipherView';
|
||||||
@@ -81,7 +83,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
|
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);
|
await this.syncService.fullSync(false);
|
||||||
|
|
||||||
this.showUpdateKey = !(await this.cryptoService.hasEncKey());
|
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