From ab506ffbdbd1a9bb2d6161aea69005cbc45fa4d9 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 21 May 2020 14:31:53 +0200 Subject: [PATCH] Resolve edit always being true for ciphers I noticed that ciphers will always have `edit = True` even if the sync response has `edit = false`. The root cause seems to be a boolean default to true. And since `false || true => true` it would always be set to true. --- src/models/response/cipherResponse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/response/cipherResponse.ts b/src/models/response/cipherResponse.ts index 580e21fa7e..d66e8f8447 100644 --- a/src/models/response/cipherResponse.ts +++ b/src/models/response/cipherResponse.ts @@ -38,7 +38,7 @@ export class CipherResponse extends BaseResponse { this.name = this.getResponseProperty('Name'); this.notes = this.getResponseProperty('Notes'); this.favorite = this.getResponseProperty('Favorite') || false; - this.edit = this.getResponseProperty('Edit') || true; + this.edit = !!this.getResponseProperty('Edit'); this.organizationUseTotp = this.getResponseProperty('OrganizationUseTotp'); this.revisionDate = this.getResponseProperty('RevisionDate'); this.collectionIds = this.getResponseProperty('CollectionIds');