Skip to content

Commit

Permalink
fix: picture list empty
Browse files Browse the repository at this point in the history
  • Loading branch information
JunaYa committed Dec 20, 2024
1 parent cabc963 commit 9676b89
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pages/main/components/SnapVault.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ async function loadData() {
checked: false,
datetime: new Date(parseInt(entry.name.replace(/^screenshot_|_|\.png$/g, ''))),
}))
}
watch(isAscending, () => {
list.value.sort((a, b) => {
return isAscending.value ? a.datetime.getTime() - b.datetime.getTime() : b.datetime.getTime() - a.datetime.getTime()
})
}
watch(isAscending, () => {
if (list.value.length > 0) {
list.value.sort((a, b) => {
return isAscending.value ? a.datetime.getTime() - b.datetime.getTime() : b.datetime.getTime() - a.datetime.getTime()
})
}
})
function onChangeAll(checked: boolean) {
Expand Down

0 comments on commit 9676b89

Please sign in to comment.