From 11aa1ffd94dd890976971bed9f679198005b49bd Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 1 Dec 2017 14:10:58 +0000 Subject: [PATCH] API: first verify, then try to decrypt! --- src/api/EteSync.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/EteSync.tsx b/src/api/EteSync.tsx index 44797c5..5630e92 100644 --- a/src/api/EteSync.tsx +++ b/src/api/EteSync.tsx @@ -105,12 +105,12 @@ export class Journal extends BaseJournal { } getInfo(cryptoManager: CryptoManager): CollectionInfo { + this.verify(cryptoManager); + if (this._content === undefined) { this._content = JSON.parse(cryptoManager.decrypt(this.encryptedContent())); } - this.verify(cryptoManager); - return new CollectionInfo(this._content); } @@ -154,12 +154,12 @@ export class Entry extends BaseJournal { } getSyncEntry(cryptoManager: CryptoManager, prevUid: string | null): SyncEntry { + this.verify(cryptoManager, prevUid); + if (this._content === undefined) { this._content = JSON.parse(cryptoManager.decrypt(this._encrypted)); } - this.verify(cryptoManager, prevUid); - return new SyncEntry(this._content); }