From 49e566b25c9b0128cee3fe65b56670a3f9fa49a2 Mon Sep 17 00:00:00 2001 From: jaasen-livefront Date: Fri, 24 Oct 2025 12:33:40 -0700 Subject: [PATCH] clean up return types --- .../vault-v2/add-edit/add-edit-v2.component.ts | 4 ++-- .../components/vault-v2/view-v2/view-v2.component.ts | 4 ++-- .../vault-item-dialog/vault-item-dialog.component.ts | 4 ++-- .../src/services/archive-cipher-utilities.service.ts | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts index c28638e4165..91f970a4dc2 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts @@ -431,7 +431,7 @@ export class AddEditV2Component implements OnInit { const cipherResponse = await this.archiveCipherUtilsService.archiveCipher(this.cipher, true); if (!cipherResponse) { - return false; + return; } this.updateCipherFromArchive( new Date(cipherResponse.revisionDate), @@ -443,7 +443,7 @@ export class AddEditV2Component implements OnInit { const cipherResponse = await this.archiveCipherUtilsService.unarchiveCipher(this.cipher); if (!cipherResponse) { - return false; + return; } this.updateCipherFromArchive(new Date(cipherResponse.revisionDate), null); }; diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts index 4701aaebdf8..c5632db19d3 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts @@ -282,7 +282,7 @@ export class ViewV2Component { const cipherResponse = await this.archiveCipherUtilsService.archiveCipher(this.cipher, true); if (!cipherResponse) { - return false; + return; } this.cipher.archivedDate = new Date(cipherResponse.archivedDate); }; @@ -291,7 +291,7 @@ export class ViewV2Component { const cipherResponse = await this.archiveCipherUtilsService.unarchiveCipher(this.cipher); if (!cipherResponse) { - return false; + return; } this.cipher.archivedDate = null; }; diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index 179386f80b5..2ff08617e78 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -569,7 +569,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { const cipherResponse = await this.archiveCipherUtilsService.archiveCipher(this.cipher, true); if (!cipherResponse) { - return false; + return; } this.updateCipherFromArchive( new Date(cipherResponse.revisionDate), @@ -581,7 +581,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { const cipherResponse = await this.archiveCipherUtilsService.unarchiveCipher(this.cipher); if (!cipherResponse) { - return false; + return; } this.updateCipherFromArchive(new Date(cipherResponse.revisionDate), null); }; diff --git a/libs/vault/src/services/archive-cipher-utilities.service.ts b/libs/vault/src/services/archive-cipher-utilities.service.ts index 319a31e2671..5d3c5c33236 100644 --- a/libs/vault/src/services/archive-cipher-utilities.service.ts +++ b/libs/vault/src/services/archive-cipher-utilities.service.ts @@ -29,13 +29,13 @@ export class ArchiveCipherUtilitiesService { * * @param cipher The cipher to archive * @param skipReprompt Whether to skip the password reprompt check - * @returns The archived CipherData on success, or false on failure or cancellation + * @returns The archived CipherData on success, or undefined on failure or cancellation */ async archiveCipher(cipher: CipherView, skipReprompt = false) { if (!skipReprompt) { const repromptPassed = await this.passwordRepromptService.passwordRepromptCheck(cipher); if (!repromptPassed) { - return false; + return; } } @@ -46,7 +46,7 @@ export class ArchiveCipherUtilitiesService { }); if (!confirmed) { - return false; + return; } const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); @@ -65,13 +65,13 @@ export class ArchiveCipherUtilitiesService { variant: "error", message: this.i18nService.t("errorOccurred"), }); - return false; + return; } } /** Unarchives a cipher * @param cipher The cipher to unarchive - * @returns The unarchived cipher on success, or false on failure + * @returns The unarchived cipher on success, or undefined on failure */ async unarchiveCipher(cipher: CipherView) { const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); @@ -90,7 +90,7 @@ export class ArchiveCipherUtilitiesService { variant: "error", message: this.i18nService.t("errorOccurred"), }); - return false; + return; } } }