Change externalId to externalID for backwards compatibility

This commit is contained in:
Robbie Antenesse 2019-05-23 14:20:54 -06:00
parent bf30f108fa
commit c5bdfa5450
2 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ login
*/ */
export function syncDictionary() { export function syncDictionary() {
if (!window.currentDictionary.hasOwnProperty('externalId')) { if (!window.currentDictionary.hasOwnProperty('externalID')) {
uploadWholeDictionary(true); uploadWholeDictionary(true);
} else { } else {
addMessage('Syncing...'); addMessage('Syncing...');
@ -41,7 +41,7 @@ export function syncDictionary() {
action: 'get-current-dictionary', action: 'get-current-dictionary',
}, remote => { }, remote => {
// console.log(remote); // console.log(remote);
if (remote.details.externalId !== window.currentDictionary.externalId) { if (remote.details.externalID !== window.currentDictionary.externalID) {
clearDictionary(); clearDictionary();
} }
const detailsSynced = syncDetails(remote.details); const detailsSynced = syncDetails(remote.details);
@ -93,7 +93,7 @@ export function uploadWholeDictionary(asNew = false) {
action: 'set-whole-current-dictionary', action: 'set-whole-current-dictionary',
dictionary, dictionary,
}, remoteId => { }, remoteId => {
window.currentDictionary.externalId = remoteId; window.currentDictionary.externalID = remoteId;
saveDictionary(); saveDictionary();
addMessage('Dictionary Uploaded Successfully'); addMessage('Dictionary Uploaded Successfully');
}, errorData => { }, 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. 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) { if (remoteDetails === false) {
direction = 'up'; 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'; direction = 'down';
} else if (remoteDetails.lastUpdated < window.currentDictionary.lastUpdated) { } else if (remoteDetails.lastUpdated < window.currentDictionary.lastUpdated) {
direction = 'up'; direction = 'up';

View File

@ -87,7 +87,7 @@ VALUES ($new_id, ?, ?, ?, ?)";
$partsOfSpeech = $result['parts_of_speech'] !== '' ? $result['parts_of_speech'] : $this->defaults['partsOfSpeech']; $partsOfSpeech = $result['parts_of_speech'] !== '' ? $result['parts_of_speech'] : $this->defaults['partsOfSpeech'];
return array( return array(
'externalId' => $this->token->hash($result['id']), 'externalID' => $this->token->hash($result['id']),
'name' => $result['name'], 'name' => $result['name'],
'specification' => $result['specification'], 'specification' => $result['specification'],
'description' => $result['description'], 'description' => $result['description'],