diff --git a/src/App.svelte b/src/App.svelte index bca5e07..23aa859 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -11,7 +11,9 @@
-

nvAux

+
+

nvAux

+

Capture and retrieve ideas at the speed of thought with nvAux, the in-the-zone note-taking app for creative professionals.

diff --git a/src/lib/NoteDetail.svelte b/src/lib/NoteDetail.svelte index ad16b16..5e6229e 100644 --- a/src/lib/NoteDetail.svelte +++ b/src/lib/NoteDetail.svelte @@ -3,7 +3,7 @@ import { onMount } from 'svelte'; import { RxDBUpdatePlugin } from 'rxdb/plugins/update'; - import { db, selectedNote, bodyText } from './store'; + import { selectedNote, bodyText } from './store'; import { debounce } from '../utils/debounce'; import { isEmptyObject } from '../utils/isEmptyObject'; @@ -11,29 +11,30 @@ import Settings from './Settings.svelte'; let innerHeight; - let db$; + let note; onMount(async () => { addRxPlugin(RxDBUpdatePlugin); - db$ = await db(); - db$.notes.findOne($selectedNote.guid).exec(); }); - const handleDebounceSave = debounce(() => !isEmptyObject($selectedNote) && updateNote(), 500); + const handleDebounceSave = debounce(() => updateNote(), 1000); const updateNote = async () => { - await $selectedNote.update({ - $set: { - body: $bodyText, - updatedAt: new Date().getTime(), - }, + // @ts-ignore + await $selectedNote.incrementalModify((data) => { + data.body = $bodyText; + data.updatedAt = new Date().getTime(); + return data; }); }; -
+
{#if isEmptyObject($selectedNote)}

No Note Selected

@@ -45,7 +46,7 @@ id="body-editor" class="block w-full h-full relative no-resize border-0 outline-none border-box bg-transparent" bind:value={$bodyText} - on:keydown={handleDebounceSave} + on:keyup={handleDebounceSave} /> {/if}
diff --git a/src/lib/StatusBar.svelte b/src/lib/StatusBar.svelte index 990bb62..bcd954e 100644 --- a/src/lib/StatusBar.svelte +++ b/src/lib/StatusBar.svelte @@ -17,11 +17,11 @@
nvAux v0.1.5-20230719-032
- +
{#if $showClock}
{format(time, 'hh:mm:ss a')}
{/if}
+ + + diff --git a/src/lib/store.js b/src/lib/store.js index e70ae68..1ba7b28 100644 --- a/src/lib/store.js +++ b/src/lib/store.js @@ -13,7 +13,7 @@ import { schema } from './schema'; const storedNoteListHeight = localStorage.getItem('noteListHeight') || 220; const storedFullScreen = JSON.parse(localStorage.getItem('fullScreen')) || false; -const storedMaximumFullScreen = JSON.parse(localStorage.getItem('maximumFullScreen')) || false; +const storedMaximumFullScreen = JSON.parse(localStorage.getItem('maximumFullScreen')) || true; const storedShowClock = JSON.parse(localStorage.getItem('showClock')) || "true"; /**