feat: add hub
This commit is contained in:
@@ -4,7 +4,7 @@ const dayFormat = new Intl.DateTimeFormat('de-DE', { day: '2-digit', month: '2-d
|
||||
|
||||
/** A note is named by its title, or by when it was created if it has none */
|
||||
export function notesDocName(doc: Pick<NotesDocSummary, 'title' | 'created'>): string {
|
||||
return doc.title || (doc.created ? nameFormat.format(new Date(doc.created)) : 'Untitled')
|
||||
return doc.title || (doc.created ? nameFormat.format(new Date(doc.created)) : 'Ohne Titel')
|
||||
}
|
||||
|
||||
export function notesDocDay(iso: string | null): string {
|
||||
@@ -70,7 +70,7 @@ export function useNewNote() {
|
||||
closeOnMobile()
|
||||
await navigateTo(`/notes/${doc.id}`)
|
||||
} catch (e) {
|
||||
toast.add({ title: 'Couldn\'t create a note', description: errorMessage(e), color: 'error', icon: 'i-lucide-triangle-alert' })
|
||||
toast.add({ title: 'Notiz konnte nicht erstellt werden', description: errorMessage(e), color: 'error', icon: 'i-lucide-triangle-alert' })
|
||||
} finally {
|
||||
creating.value = false
|
||||
}
|
||||
@@ -91,7 +91,7 @@ export function useDeleteNote() {
|
||||
if (String(doc.id) === route.params.id) await navigateTo('/notes')
|
||||
await remove(doc.id)
|
||||
} catch (e) {
|
||||
toast.add({ title: 'Couldn\'t delete the note', description: errorMessage(e), color: 'error', icon: 'i-lucide-triangle-alert' })
|
||||
toast.add({ title: 'Notiz konnte nicht gelöscht werden', description: errorMessage(e), color: 'error', icon: 'i-lucide-triangle-alert' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user