feat(settings): add quickAddDefaultReminders field to frontend settings

This commit is contained in:
kolaente 2026-04-11 23:41:02 +02:00 committed by kolaente
parent 9a12c8f254
commit e85f3fd84c
5 changed files with 14 additions and 1 deletions

View File

@ -378,6 +378,7 @@ async function toggleSortOrder() {
frontendSettings: {
...authStore.settings.frontendSettings,
commentSortOrder: newOrder,
quickAddDefaultReminders: [...(authStore.settings.frontendSettings.quickAddDefaultReminders ?? [])],
},
},
showMessage: false,

View File

@ -134,6 +134,7 @@ export function useSidebarResize() {
frontendSettings: {
...authStore.settings.frontendSettings,
sidebarWidth: currentWidth.value,
quickAddDefaultReminders: [...(authStore.settings.frontendSettings.quickAddDefaultReminders ?? [])],
},
}
await authStore.saveUserSettings({

View File

@ -1,5 +1,6 @@
import type {IAbstract} from './IAbstract'
import type {IProject} from './IProject'
import type {ITaskReminder} from '@/modelTypes/ITaskReminder'
import type {PrefixMode} from '@/modules/quickAddMagic'
import type {BasicColorSchema} from '@vueuse/core'
import type {SupportedLocale} from '@/i18n'
@ -26,6 +27,7 @@ export interface IFrontendSettings {
sidebarWidth: number | null
commentSortOrder: 'asc' | 'desc'
desktopQuickEntryShortcut: string
quickAddDefaultReminders: ITaskReminder[]
}
export interface IExtraSettingsLink {

View File

@ -37,6 +37,7 @@ export default class UserSettingsModel extends AbstractModel<IUserSettings> impl
sidebarWidth: null,
commentSortOrder: 'asc',
desktopQuickEntryShortcut: 'CmdOrCtrl+Shift+A',
quickAddDefaultReminders: [],
}
extraSettingsLinks = {}

View File

@ -499,6 +499,8 @@ const settings = ref<IUserSettings>({
timeFormat: authStore.settings.frontendSettings.timeFormat ?? TIME_FORMAT.HOURS_12,
// Add fallback for old settings that don't have the default task relation type set
defaultTaskRelationType: authStore.settings.frontendSettings.defaultTaskRelationType ?? 'related',
// Clone to escape the store's readonly array type.
quickAddDefaultReminders: [...(authStore.settings.frontendSettings.quickAddDefaultReminders ?? [])],
},
})
@ -630,7 +632,13 @@ watch(
if (Object.keys(settings.value).length !== 0) {
return
}
settings.value = {...authStore.settings}
settings.value = {
...authStore.settings,
frontendSettings: {
...authStore.settings.frontendSettings,
quickAddDefaultReminders: [...(authStore.settings.frontendSettings.quickAddDefaultReminders ?? [])],
},
}
},
{immediate: true},
)