From c5bdfa545027582520cecaf4c45ccc2a91f6552e Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Thu, 23 May 2019 14:20:54 -0600 Subject: [PATCH] Change externalId to externalID for backwards compatibility --- src/js/account/sync.js | 8 ++++---- src/php/api/Dictionary.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/account/sync.js b/src/js/account/sync.js index 46faef7..28a37e9 100644 --- a/src/js/account/sync.js +++ b/src/js/account/sync.js @@ -33,7 +33,7 @@ login */ export function syncDictionary() { - if (!window.currentDictionary.hasOwnProperty('externalId')) { + if (!window.currentDictionary.hasOwnProperty('externalID')) { uploadWholeDictionary(true); } else { addMessage('Syncing...'); @@ -41,7 +41,7 @@ export function syncDictionary() { action: 'get-current-dictionary', }, remote => { // console.log(remote); - if (remote.details.externalId !== window.currentDictionary.externalId) { + if (remote.details.externalID !== window.currentDictionary.externalID) { clearDictionary(); } const detailsSynced = syncDetails(remote.details); @@ -93,7 +93,7 @@ export function uploadWholeDictionary(asNew = false) { action: 'set-whole-current-dictionary', dictionary, }, remoteId => { - window.currentDictionary.externalId = remoteId; + window.currentDictionary.externalID = remoteId; saveDictionary(); addMessage('Dictionary Uploaded Successfully'); }, errorData => { @@ -109,7 +109,7 @@ export function syncDetails(remoteDetails = false) { let direction; // This is if/else if tree the only way I can think to correctly prioritize this when to upload vs download. if (remoteDetails === false) { direction = 'up'; - } else if (!window.currentDictionary.hasOwnProperty('externalId')) { // If mismatched id, dictionary will be cleared, allowing it to be overwritten + } else if (!window.currentDictionary.hasOwnProperty('externalID')) { // If mismatched id, dictionary will be cleared, allowing it to be overwritten direction = 'down'; } else if (remoteDetails.lastUpdated < window.currentDictionary.lastUpdated) { direction = 'up'; diff --git a/src/php/api/Dictionary.php b/src/php/api/Dictionary.php index f0586a9..df9e00d 100644 --- a/src/php/api/Dictionary.php +++ b/src/php/api/Dictionary.php @@ -87,7 +87,7 @@ VALUES ($new_id, ?, ?, ?, ?)"; $partsOfSpeech = $result['parts_of_speech'] !== '' ? $result['parts_of_speech'] : $this->defaults['partsOfSpeech']; return array( - 'externalId' => $this->token->hash($result['id']), + 'externalID' => $this->token->hash($result['id']), 'name' => $result['name'], 'specification' => $result['specification'], 'description' => $result['description'],