From 7e6ed69e358e7cb2d4129917ffff0af6f11d7af4 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 5 Jan 2020 11:17:22 +0200 Subject: [PATCH] SyncGate: fix issue with empty journals not working. Before this we weren't able to import/add entries to empty journals. This was introduced in c6eafadb8bdc9eb3fc1d95ff53fae24340dde81c --- src/store/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/actions.ts b/src/store/actions.ts index 86fd48f..095b217 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -182,7 +182,7 @@ export function fetchAll(etesync: CredentialsData, currentEntries: EntriesType) const prevUid = currentEntries.get(journal.uid)?.value?.last(undefined)?.uid ?? null; // FIXME: expose it in a non-hacky way. - if (prevUid === (journal as any)._json.lastUid) { + if (prevUid && (prevUid === (journal as any)._json.lastUid)) { return true; } return dispatch(fetchEntries(etesync, journal.uid, prevUid));