This commit is contained in:
Robbie Antenesse 2020-03-04 09:22:43 -07:00
commit 689a5d3a59
4 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "lexiconga", "name": "lexiconga",
"version": "2.1.6", "version": "2.1.7",
"description": "The quick and easy dictionary builder for constructed languages.", "description": "The quick and easy dictionary builder for constructed languages.",
"main": "template-index.html", "main": "template-index.html",
"repository": "https://github.com/Alamantus/Lexiconga.git", "repository": "https://github.com/Alamantus/Lexiconga.git",

View File

@ -174,10 +174,11 @@ export function syncWords(remoteWords, deletedWords) {
} }
remoteWords.forEach(remoteWord => { remoteWords.forEach(remoteWord => {
let localWord = words.find(word => word.wordId === remoteWord.wordId); const localWordIndex = words.findIndex(word => word.wordId === remoteWord.wordId);
const localWord = words[localWordIndex];
if (localWord) { if (localWord) {
if (localWord.lastUpdated < remoteWord.lastUpdated) { if (localWord.lastUpdated < remoteWord.lastUpdated) {
localWord = remoteWord; words[localWordIndex] = remoteWord;
} else if (localWord.lastUpdated > remoteWord.lastUpdated) { } else if (localWord.lastUpdated > remoteWord.lastUpdated) {
// Add more-recently-updated words to upload // Add more-recently-updated words to upload
localWordsToUpload.push(localWord); localWordsToUpload.push(localWord);

View File

@ -258,7 +258,7 @@ WHERE dictionary=$dictionary";
$word_ids = array(); $word_ids = array();
$most_recent_word_update = 0; $most_recent_word_update = 0;
foreach($words as $word) { foreach($words as $word) {
$last_updated = isset($word['lastUpdated']) ? $word['createdOn'] : $word['lastUpdated']; $last_updated = isset($word['lastUpdated']) ? $word['lastUpdated'] : $word['createdOn'];
if ($most_recent_word_update < $last_updated) { if ($most_recent_word_update < $last_updated) {
$most_recent_word_update = $last_updated; $most_recent_word_update = $last_updated;
} }

View File

@ -134,7 +134,7 @@ switch ($view) {
oldLoad && oldLoad(); oldLoad && oldLoad();
if (UpUp) { if (UpUp) {
UpUp.start({ UpUp.start({
'cache-version': '2.1.6', 'cache-version': '2.1.7',
'content-url': 'offline.html', 'content-url': 'offline.html',
'assets': [ 'assets': [
\"" . implode('","', $files) . "\" \"" . implode('","', $files) . "\"