store settings in localstorage

This commit is contained in:
2023-05-24 23:30:28 +02:00
parent 79f81cb83f
commit cf8d965e64
4 changed files with 49 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
import { activeNotesSource, notesSources } from '@/composables/useNotes'
import { signOut as firebaseSignOut } from '@/composables/useFirebase'
import { OnClickOutside } from '@vueuse/components'
import { preferredNotesSource } from '@/composables/useSettings'
const sourceLabels: { [source: string]: string } = {
local: 'Switch to local notes',
firebase: 'Switch to cloud notes'
@@ -17,6 +19,7 @@ const availableNoteSources = computed(() =>
const signOut = async (close: () => Promise<boolean>) => {
await firebaseSignOut()
preferredNotesSource.value = null
close()
}
@@ -41,7 +44,7 @@ const handleClick = (fn: (...args: any[]) => any) => {
class="text-base"
v-for="{ source, label } in availableNoteSources"
:key="source"
@click="handleClick(() => (activeNotesSource = source))"
@click="handleClick(() => (preferredNotesSource = source))"
>
<a>
<i class="fa-fw fa-solid fa-database" />