From 1b46687b6a9880f2821f3e2f93aadcddedcc0f33 Mon Sep 17 00:00:00 2001 From: Marco Crapts Date: Mon, 22 May 2023 10:02:52 +0200 Subject: [PATCH] fix stretch + default notes --- src/composables/useNotes.ts | 7 +++---- src/style.scss | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/composables/useNotes.ts b/src/composables/useNotes.ts index 231dced..9607bc4 100644 --- a/src/composables/useNotes.ts +++ b/src/composables/useNotes.ts @@ -81,7 +81,7 @@ export const setRootNote = (noteId: string) => { setActiveNote(noteId) } -export const setDefaultNotes = (defaultNotes: BaseNote[]) => { +export const insertDefaultNotes = (defaultNotes: BaseNote[]) => { defaultNotes.forEach((defaultNote) => { baseNotes.value[defaultNote.id] = defaultNote }) @@ -203,9 +203,8 @@ watch( } else if (activeNotesSource.value === 'firebase') { console.log('get notes from firebase') } - if (Object.entries(baseNotes.value).length === 0) { - setDefaultNotes(defaultNotes) - } + if (!rootNote.value) insertDefaultNotes(defaultNotes) + setActiveNote(rootNote.value?.id) }, { immediate: true } diff --git a/src/style.scss b/src/style.scss index 80ef08c..24b0bca 100644 --- a/src/style.scss +++ b/src/style.scss @@ -5,12 +5,12 @@ @import '@fontsource/source-sans-pro/300'; html { - height: stretch; + height: -webkit-fill-available; } body { min-height: 100vh; - min-height: stretch; + min-height: -webkit-fill-available; font-family: 'Source Sans Pro', sans-serif; overflow-y: scroll; @apply flex flex-col bg-gray-100;