File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
resources/scripts/components/server/files Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import useFileManagerSwr from '@/plugins/useFileManagerSwr';
1616import MassActionsBar from '@/components/server/files/MassActionsBar' ;
1717import UploadButton from '@/components/server/files/UploadButton' ;
1818import ServerContentBlock from '@/components/elements/ServerContentBlock' ;
19+ import { useStoreActions } from '@/state/hooks' ;
1920
2021const sortFiles = ( files : FileObject [ ] ) : FileObject [ ] => {
2122 return files . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
@@ -26,11 +27,12 @@ export default () => {
2627 const id = ServerContext . useStoreState ( state => state . server . data ! . id ) ;
2728 const { hash } = useLocation ( ) ;
2829 const { data : files , error, mutate } = useFileManagerSwr ( ) ;
29-
30+ const clearFlashes = useStoreActions ( actions => actions . flashes . clearFlashes ) ;
3031 const setDirectory = ServerContext . useStoreActions ( actions => actions . files . setDirectory ) ;
3132 const setSelectedFiles = ServerContext . useStoreActions ( actions => actions . files . setSelectedFiles ) ;
3233
3334 useEffect ( ( ) => {
35+ clearFlashes ( 'files' ) ;
3436 setSelectedFiles ( [ ] ) ;
3537 setDirectory ( hash . length > 0 ? hash : '/' ) ;
3638 } , [ hash ] ) ;
You can’t perform that action at this time.
0 commit comments