diff --git a/src/components/create.svelte b/src/components/create.svelte index b42f44d..3bbe77e 100644 --- a/src/components/create.svelte +++ b/src/components/create.svelte @@ -42,9 +42,9 @@ */ const sf = { listid: abbForm.target.value, - shortform: abbForm.shortform, - phrase: abbForm.phrase, - used: new Date(0), + shortform: abbForm.shortform.replace(/\s/g,"").toLowerCase(), + phrase: abbForm.phrase.trim(), + last_used: new Date(0), uses: 0, remind: 0, updated: Date.now(), @@ -99,7 +99,7 @@ - + Förkortning diff --git a/src/components/textarea.svelte b/src/components/textarea.svelte index 2499e98..ac8e49c 100644 --- a/src/components/textarea.svelte +++ b/src/components/textarea.svelte @@ -110,6 +110,7 @@ on:keyup={change} on:beforeinput={input} bind:value={appState.text} + spellcheck="false" > diff --git a/src/db/main.ts b/src/db/main.ts index 1004439..6933b2f 100644 --- a/src/db/main.ts +++ b/src/db/main.ts @@ -35,7 +35,7 @@ export class SkrivertDB extends Dexie { super("skrivertdb"); this.version(1).stores({ syncInfo: "key, last_sync", - shortforms: "++id, [listid+shortform], phrase, last_use, uses, remind, updated", + shortforms: "++id, [listid+shortform], phrase, used, uses, remind, updated", lists: "++id, name, type, updated", }); this.on("ready", async (db) => { diff --git a/src/modules/shortforms.ts b/src/modules/shortforms.ts index 73838e1..004b385 100644 --- a/src/modules/shortforms.ts +++ b/src/modules/shortforms.ts @@ -59,7 +59,7 @@ export function expandShortform( const shortform = ShortForm.toLowerCase(); if (cache.has(shortform)) { const cachedShortform = cache.get(shortform); - cachedShortform.last = u; + cachedShortform.used = u; cache.set(shortform, cachedShortform); if (shortform.match(/(\d+)/) || ShortForm === shortform) {