( previousSettings: VaultSettings, requestedSettings: VaultSettings )
| 2776 | } |
| 2777 | |
| 2778 | function withDateNotePatternHistory( |
| 2779 | previousSettings: VaultSettings, |
| 2780 | requestedSettings: VaultSettings |
| 2781 | ): VaultSettings { |
| 2782 | const previous = normalizeVaultSettings(previousSettings) |
| 2783 | const next = normalizeVaultSettings(requestedSettings) |
| 2784 | const previousDaily = currentDailyPatternFromSettings(previous) |
| 2785 | const nextDaily = currentDailyPatternFromSettings(next) |
| 2786 | const previousWeekly = currentWeeklyPatternFromSettings(previous) |
| 2787 | const nextWeekly = currentWeeklyPatternFromSettings(next) |
| 2788 | |
| 2789 | return { |
| 2790 | ...next, |
| 2791 | dailyNotes: { |
| 2792 | ...next.dailyNotes, |
| 2793 | legacyPatterns: |
| 2794 | previous.dailyNotes.enabled && |
| 2795 | next.dailyNotes.enabled && |
| 2796 | dateNotePatternKey(previousDaily) !== dateNotePatternKey(nextDaily) |
| 2797 | ? appendDateNotePatternHistory( |
| 2798 | next.dailyNotes.legacyPatterns, |
| 2799 | previousDaily, |
| 2800 | nextDaily |
| 2801 | ) |
| 2802 | : next.dailyNotes.legacyPatterns |
| 2803 | }, |
| 2804 | weeklyNotes: { |
| 2805 | ...next.weeklyNotes, |
| 2806 | legacyPatterns: |
| 2807 | previous.weeklyNotes.enabled && |
| 2808 | next.weeklyNotes.enabled && |
| 2809 | dateNotePatternKey(previousWeekly) !== dateNotePatternKey(nextWeekly) |
| 2810 | ? appendDateNotePatternHistory( |
| 2811 | next.weeklyNotes.legacyPatterns, |
| 2812 | previousWeekly, |
| 2813 | nextWeekly |
| 2814 | ) |
| 2815 | : next.weeklyNotes.legacyPatterns |
| 2816 | } |
| 2817 | } |
| 2818 | } |
| 2819 | |
| 2820 | function rewriteNoteCommentsPath( |
| 2821 | comments: Record<string, NoteComment[]>, |
no test coverage detected