From d9fb36a9a63a8089372ee7dd216acf9896b9624d Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 19 Feb 2020 22:09:02 +0100 Subject: [PATCH] fixes --- src/services/options_init.js | 2 +- src/services/sync.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/services/options_init.js b/src/services/options_init.js index 1894410e2..d6e35e56e 100644 --- a/src/services/options_init.js +++ b/src/services/options_init.js @@ -104,7 +104,7 @@ function getKeyboardDefaultOptions() { .filter(ka => !!ka.actionName) .map(ka => { return { - name: "keyboardShortcuts" + ka.actionName, + name: "keyboardShortcuts" + ka.actionName.charAt(0).toUpperCase() + ka.actionName.slice(1), value: JSON.stringify(ka.defaultShortcuts), isSynced: false }; diff --git a/src/services/sync.js b/src/services/sync.js index bc6b259fa..41cca5e9c 100644 --- a/src/services/sync.js +++ b/src/services/sync.js @@ -156,7 +156,10 @@ async function pullSync(syncContext) { appliedPulls++; } - await syncUpdateService.updateEntity(sync, entity, syncContext.sourceId); + // can be undefined for options with isSynced=false + if (entity) { + await syncUpdateService.updateEntity(sync, entity, syncContext.sourceId); + } } stats.outstandingPulls = resp.maxSyncId - sync.id; @@ -318,6 +321,8 @@ async function getSyncRecords(syncs) { const entity = await getEntityRow(sync.entityName, sync.entityId); if (sync.entityName === 'options' && !entity.isSynced) { + records.push({sync}); + continue; }