Thomas There are a couple of challenges here. 1) Files gallery caches pages directly in the app (Javascript), and this would need to get emptied. This is already done for built-in file manager features, but won't automatically apply for your custom function. 2) You don't have access to native Files functions (in this case _f.get_files(dir)
), so even if internal cache was not an issue, you can't trigger Files functions from your external custom function.
Recommended solution
I think your best solution for now, would be to RELOAD folder B in browser. This will then bypass the cache issue, and can easily be executed in your custom function. Something like this, before your xhttp.send()
:
xhttp.onreadystatechange = () => {
if (xhttp.readyState !== 4 || xhttp.status !== 200) return;
location.href = '?' + item.path; // you may need to adjust this
}
In a future release, I will be adding native functions for copy, move and selection for mass-file actions. I will also add Javascript config options to disable internal Javascript caching, and possibly extend the API so internal functions become accessible from custom actions.