fix click outside

This commit is contained in:
2023-05-25 00:11:18 +02:00
parent d62444f65e
commit 84376263c8
3 changed files with 13 additions and 19 deletions

View File

@@ -14,18 +14,18 @@ export const notesSources = computed(() => ({
firebase: initialized.value && user.value
}))
export const availableNotesSources = computed(() =>
export const availableNotesSources = computed<notesSourceValues[]>(() =>
Object.entries(notesSources.value)
.filter(([, enabled]) => enabled)
.map(([source]) => source)
.map(([source]) => source as notesSourceValues)
)
export type notesSourceValues = keyof typeof notesSources.value | null
export type notesSourceValues = keyof typeof notesSources.value
export const activeNotesSource = ref<notesSourceValues>(null)
export const activeNotesSource = ref<notesSourceValues | null>(null)
watchEffect(() => {
const getSource = (): notesSourceValues => {
const getSource = (): notesSourceValues | null => {
if (!initialized.value) return null
if (
preferredNotesSource.value &&

View File

@@ -1,10 +1,10 @@
import type { notesSourceValues } from '@/composables/useNotes'
interface Settings {
preferredNotesSource: notesSourceValues
preferredNotesSource: notesSourceValues | null
}
export const preferredNotesSource = ref<notesSourceValues>(null)
export const preferredNotesSource = ref<notesSourceValues | null>(null)
const updateSettings = () => {
const settings: Settings = {