[PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components (#8908)
* [PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components * [PM-7710] Avoid re-indexing ciphers on current tab component and re-setting null storage values for popup components
This commit is contained in:
parent
2ff3fa92fb
commit
c3d4c7aa3d
|
@ -46,7 +46,9 @@ export class BrowserSendStateService {
|
||||||
* the send component on the browser
|
* the send component on the browser
|
||||||
*/
|
*/
|
||||||
async setBrowserSendComponentState(value: BrowserSendComponentState): Promise<void> {
|
async setBrowserSendComponentState(value: BrowserSendComponentState): Promise<void> {
|
||||||
await this.activeUserBrowserSendComponentState.update(() => value);
|
await this.activeUserBrowserSendComponentState.update(() => value, {
|
||||||
|
shouldUpdate: (current) => !(current == null && value == null),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the active user's browser component state
|
/** Get the active user's browser component state
|
||||||
|
@ -60,6 +62,8 @@ export class BrowserSendStateService {
|
||||||
* @param { BrowserComponentState } value set the scroll position and search text for the send component on the browser
|
* @param { BrowserComponentState } value set the scroll position and search text for the send component on the browser
|
||||||
*/
|
*/
|
||||||
async setBrowserSendTypeComponentState(value: BrowserComponentState): Promise<void> {
|
async setBrowserSendTypeComponentState(value: BrowserComponentState): Promise<void> {
|
||||||
await this.activeUserBrowserSendTypeComponentState.update(() => value);
|
await this.activeUserBrowserSendTypeComponentState.update(() => value, {
|
||||||
|
shouldUpdate: (current) => !(current == null && value == null),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,6 +292,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
|
||||||
const ciphers = await this.cipherService.getAllDecryptedForUrl(
|
const ciphers = await this.cipherService.getAllDecryptedForUrl(
|
||||||
this.url,
|
this.url,
|
||||||
otherTypes.length > 0 ? otherTypes : null,
|
otherTypes.length > 0 ? otherTypes : null,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.loginCiphers = [];
|
this.loginCiphers = [];
|
||||||
|
|
|
@ -52,7 +52,9 @@ export class VaultBrowserStateService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setBrowserGroupingsComponentState(value: BrowserGroupingsComponentState): Promise<void> {
|
async setBrowserGroupingsComponentState(value: BrowserGroupingsComponentState): Promise<void> {
|
||||||
await this.activeUserVaultBrowserGroupingsComponentState.update(() => value);
|
await this.activeUserVaultBrowserGroupingsComponentState.update(() => value, {
|
||||||
|
shouldUpdate: (current) => !(current == null && value == null),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBrowserVaultItemsComponentState(): Promise<BrowserComponentState> {
|
async getBrowserVaultItemsComponentState(): Promise<BrowserComponentState> {
|
||||||
|
@ -60,6 +62,8 @@ export class VaultBrowserStateService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setBrowserVaultItemsComponentState(value: BrowserComponentState): Promise<void> {
|
async setBrowserVaultItemsComponentState(value: BrowserComponentState): Promise<void> {
|
||||||
await this.activeUserVaultBrowserComponentState.update(() => value);
|
await this.activeUserVaultBrowserComponentState.update(() => value, {
|
||||||
|
shouldUpdate: (current) => !(current == null && value == null),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ export abstract class CipherService {
|
||||||
url: string,
|
url: string,
|
||||||
includeOtherTypes?: CipherType[],
|
includeOtherTypes?: CipherType[],
|
||||||
defaultMatch?: UriMatchStrategySetting,
|
defaultMatch?: UriMatchStrategySetting,
|
||||||
|
reindexCiphers?: boolean,
|
||||||
) => Promise<CipherView[]>;
|
) => Promise<CipherView[]>;
|
||||||
getAllFromApiForOrganization: (organizationId: string) => Promise<CipherView[]>;
|
getAllFromApiForOrganization: (organizationId: string) => Promise<CipherView[]>;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -441,6 +441,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||||
url: string,
|
url: string,
|
||||||
includeOtherTypes?: CipherType[],
|
includeOtherTypes?: CipherType[],
|
||||||
defaultMatch: UriMatchStrategySetting = null,
|
defaultMatch: UriMatchStrategySetting = null,
|
||||||
|
reindexCiphers = true,
|
||||||
): Promise<CipherView[]> {
|
): Promise<CipherView[]> {
|
||||||
if (url == null && includeOtherTypes == null) {
|
if (url == null && includeOtherTypes == null) {
|
||||||
return Promise.resolve([]);
|
return Promise.resolve([]);
|
||||||
|
@ -449,7 +450,9 @@ export class CipherService implements CipherServiceAbstraction {
|
||||||
const equivalentDomains = await firstValueFrom(
|
const equivalentDomains = await firstValueFrom(
|
||||||
this.domainSettingsService.getUrlEquivalentDomains(url),
|
this.domainSettingsService.getUrlEquivalentDomains(url),
|
||||||
);
|
);
|
||||||
const ciphers = await this.getAllDecrypted();
|
const ciphers = reindexCiphers
|
||||||
|
? await this.getAllDecrypted()
|
||||||
|
: await this.getDecryptedCiphers();
|
||||||
defaultMatch ??= await firstValueFrom(this.domainSettingsService.defaultUriMatchStrategy$);
|
defaultMatch ??= await firstValueFrom(this.domainSettingsService.defaultUriMatchStrategy$);
|
||||||
|
|
||||||
return ciphers.filter((cipher) => {
|
return ciphers.filter((cipher) => {
|
||||||
|
@ -1135,7 +1138,9 @@ export class CipherService implements CipherServiceAbstraction {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setAddEditCipherInfo(value: AddEditCipherInfo) {
|
async setAddEditCipherInfo(value: AddEditCipherInfo) {
|
||||||
await this.addEditCipherInfoState.update(() => value);
|
await this.addEditCipherInfoState.update(() => value, {
|
||||||
|
shouldUpdate: (current) => !(current == null && value == null),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
Loading…
Reference in New Issue