When accepting a remote share, an ajax request is sent to the server. Only once this request returns should the file list be reloaded.
Moved external share JS code into a small plugin to make it testable. Added unit test for the external share dialog logic + ajax calls.