fix: persist completed item visibility
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
Settings, Trash2, X, Repeat2,
|
||||
} from 'lucide-vue-next'
|
||||
import { buildTaskRrule, defaultTaskDueAt, filterTasks, fromDateTimeLocal, groupTaskTree, moveItemWithinScope, parseTaskRrule, renderMarkdown, toDateTimeLocal, type TaskRepeatConfig } from './lib/task-utils'
|
||||
import { defaultView, isTaskView, nextTotalAfterLocalTaskAdd, shouldToggleRowSwipe, writeCountdownCache } from './lib/mvp-utils'
|
||||
import { defaultView, isTaskView, nextTotalAfterLocalTaskAdd, readStoredBoolean, shouldToggleRowSwipe, writeCountdownCache, writeStoredBoolean } from './lib/mvp-utils'
|
||||
import { csrfHeader } from './lib/csrf'
|
||||
import MvpPanel from './MvpPanel.vue'
|
||||
import CountdownPanel from './CountdownPanel.vue'
|
||||
@@ -43,7 +43,8 @@ const mobileDetail = ref(false)
|
||||
const mobileMore = ref(false)
|
||||
const moreSettingsOpen = ref(false)
|
||||
const markdownPreview = ref(false)
|
||||
const showCompleted = ref(true)
|
||||
const SHOW_COMPLETED_STORAGE_KEY = 'dodo.show-completed'
|
||||
const showCompleted = ref(readStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, true))
|
||||
const page = ref(1)
|
||||
const pageSize = 50
|
||||
const totalTasks = ref(0)
|
||||
@@ -242,7 +243,8 @@ watch(query, () => {
|
||||
page.value = 1
|
||||
searchTimer = window.setTimeout(() => loadAll(), 250)
|
||||
})
|
||||
watch(showCompleted, () => {
|
||||
watch(showCompleted, (value) => {
|
||||
writeStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, value)
|
||||
if (isTaskView(activeView.value)) { page.value = 1; loadAll() }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user