diff --git a/src/constants.js b/src/constants.js index 4ab6656..dca587e 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,6 @@ import { getTimestampInSeconds } from "./helpers"; -export const MIGRATE_VERSION = '2.0.0'; +export const MIGRATE_VERSION = '2.0.1'; export const DEFAULT_DICTIONARY = { name: 'New', specification: 'Dictionary', @@ -12,25 +12,29 @@ export const DEFAULT_DICTIONARY = { consonants: [], vowels: [], blends: [], - phonotactics: { - onset: [], - nucleus: [], - coda: [], - exceptions: '', - }, + }, + phonotactics: { + onset: [], + nucleus: [], + coda: [], + notes: '', }, orthography: { + translations: [], notes: '', }, grammar: { notes: '', }, - // custom: [ - // // { - // // name: 'Example Tab', - // // content: `This is an _example_ tab to show how **tabs** work with [Markdown](${ MARKDOWN_LINK })!`, - // // } - // ], + custom: { + css: '', + // tabs: [ + // { + // name: 'Example Tab', + // content: `This is an _example_ tab to show how **tabs** work with [Markdown](${ MARKDOWN_LINK })!`, + // } + // ], + }, }, words: [ /* { diff --git a/src/js/migration.js b/src/js/migration.js index 6709b5c..0b2d0bb 100644 --- a/src/js/migration.js +++ b/src/js/migration.js @@ -103,6 +103,17 @@ export function migrateDictionary() { migrated = true; } else if (window.currentDictionary.version !== MIGRATE_VERSION) { switch (window.currentDictionary.version) { + case '2.0.1': { + window.currentDictionary.details.phonotactics = Object.assign({}, window.currentDictionary.details.phonology.phonotactics); + delete window.currentDictionary.details.phonology.phonotactics; + window.currentDictionary.details.phonotactics.notes = window.currentDictionary.details.phonotactics.exceptions; + delete window.currentDictionary.details.phonotactics.exceptions; + // Add window.currentDictionary.details.orthography.translations = []; + // Add window.currentDictionary.custom.css = ''; + window.currentDictionary = Object.assign({}, DEFAULT_DICTIONARY, window.currentDictionary); + migrated = true; + break; + } default: console.error('Unknown version'); break; } }