(patch: {
primaryNotesLocation?: PrimaryNotesLocation
dailyEnabled?: boolean
dailyDirectory?: string
})
| 795 | }, [dailyDirectory]) |
| 796 | |
| 797 | const commit = (patch: { |
| 798 | primaryNotesLocation?: PrimaryNotesLocation |
| 799 | dailyEnabled?: boolean |
| 800 | dailyDirectory?: string |
| 801 | }): void => { |
| 802 | const current = useStore.getState().vaultSettings |
| 803 | void setVaultSettings({ |
| 804 | ...current, |
| 805 | primaryNotesLocation: patch.primaryNotesLocation ?? current.primaryNotesLocation, |
| 806 | dailyNotes: { |
| 807 | ...current.dailyNotes, |
| 808 | enabled: patch.dailyEnabled ?? current.dailyNotes.enabled, |
| 809 | directory: |
| 810 | patch.dailyDirectory !== undefined |
| 811 | ? normalizeDailyNotesDirectory(patch.dailyDirectory) |
| 812 | : current.dailyNotes.directory |
| 813 | } |
| 814 | }) |
| 815 | } |
| 816 | |
| 817 | if (!hasVault) { |
| 818 | return ( |
no test coverage detected