|
|
|
@ -127,6 +127,7 @@ export const FileExplorer = (props: FileExplorerProps) => { |
|
|
|
|
if (state.fileManager) { |
|
|
|
|
filesProvider.event.register('fileExternallyChanged', fileExternallyChanged) |
|
|
|
|
filesProvider.event.register('fileRenamedError', fileRenamedError) |
|
|
|
|
filesProvider.event.register('rootFolderChanged', rootFolderChanged) |
|
|
|
|
} |
|
|
|
|
}, [state.fileManager]) |
|
|
|
|
|
|
|
|
@ -482,6 +483,15 @@ export const FileExplorer = (props: FileExplorerProps) => { |
|
|
|
|
}, null) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// register to event of the file provider
|
|
|
|
|
// files.event.register('rootFolderChanged', rootFolderChanged)
|
|
|
|
|
const rootFolderChanged = async () => { |
|
|
|
|
const files = await fetchDirectoryContent(name) |
|
|
|
|
setState(prevState => { |
|
|
|
|
return { ...prevState, files } |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const uploadFile = (target) => { |
|
|
|
|
// TODO The file explorer is merely a view on the current state of
|
|
|
|
|
// the files module. Please ask the user here if they want to overwrite
|
|
|
|
|