Skip to content

Commit 4607f7c

Browse files
fix(store/files): restore saved filters on page load using persisted state instead of chips
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 284bf6a commit 4607f7c

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/store/files.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,16 +567,14 @@ export const useFilesStore = function(...args) {
567567
params.set(key, value)
568568
}
569569
}
570-
const { chips } = useFiltersStore()
571-
if (chips?.status) {
572-
chips.status.forEach(status => {
573-
params.append('status[]', status.id)
574-
})
575-
}
576-
if (chips?.modified?.length) {
577-
const { start, end } = chips.modified[0]
578-
params.set('start', Math.floor(start / 1000))
579-
params.set('end', Math.floor(end / 1000))
570+
const filtersStore = useFiltersStore()
571+
filtersStore.filterStatusArray.forEach(id => {
572+
params.append('status[]', id)
573+
})
574+
const modifiedRange = filtersStore.filterModifiedRange
575+
if (modifiedRange) {
576+
params.set('start', Math.floor(modifiedRange.start / 1000))
577+
params.set('end', Math.floor(modifiedRange.end / 1000))
580578
}
581579
const { sortingMode, sortingDirection } = useFilesSortingStore()
582580
if (sortingMode) {

0 commit comments

Comments
 (0)