Browse Source

clean up return types

PM-24560
jaasen-livefront 2 months ago
parent
commit
49e566b25c
No known key found for this signature in database
  1. 4
      apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts
  2. 4
      apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts
  3. 4
      apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts
  4. 12
      libs/vault/src/services/archive-cipher-utilities.service.ts

4
apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts

@ -431,7 +431,7 @@ export class AddEditV2Component implements OnInit { @@ -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 { @@ -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);
};

4
apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts

@ -282,7 +282,7 @@ export class ViewV2Component { @@ -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 { @@ -291,7 +291,7 @@ export class ViewV2Component {
const cipherResponse = await this.archiveCipherUtilsService.unarchiveCipher(this.cipher);
if (!cipherResponse) {
return false;
return;
}
this.cipher.archivedDate = null;
};

4
apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts

@ -569,7 +569,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { @@ -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 { @@ -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);
};

12
libs/vault/src/services/archive-cipher-utilities.service.ts

@ -29,13 +29,13 @@ export class ArchiveCipherUtilitiesService { @@ -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 { @@ -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 { @@ -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 { @@ -90,7 +90,7 @@ export class ArchiveCipherUtilitiesService {
variant: "error",
message: this.i18nService.t("errorOccurred"),
});
return false;
return;
}
}
}

Loading…
Cancel
Save