fix flask file manager cache

This commit is contained in:
Qing
2023-01-08 20:53:55 +08:00
parent ec596ffd39
commit 9de96a09c2
4 changed files with 87 additions and 14 deletions

View File

@@ -109,6 +109,9 @@ export default function FileManager(props: Props) {
)
useEffect(() => {
if (!show) {
return
}
const fetchData = async () => {
try {
const filenames = await getMedias(tab)
@@ -141,7 +144,15 @@ export default function FileManager(props: Props) {
}
}
fetchData()
}, [setToastState, tab, debouncedSearchText, sortBy, sortOrder, photoWidth])
}, [
setToastState,
tab,
debouncedSearchText,
sortBy,
sortOrder,
photoWidth,
show,
])
const onScroll = (event: SyntheticEvent) => {
setScrollTop(event.currentTarget.scrollTop)