Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ function ElectrophysiologyUploader(props) {
});
};

const refreshForm = () => {
setData({});
fetchData();
};

if (!isLoaded) {
return <Loader />;
}
Expand Down Expand Up @@ -96,7 +91,7 @@ function ElectrophysiologyUploader(props) {
<TabPane TabId={tabList[1].id}>
<UploadForm
uploadURL={`${DataURL}/upload`}
refreshPage={refreshForm}
browseURL={`${DataURL}#browse`}
t={t}
/>
</TabPane>
Expand Down
8 changes: 6 additions & 2 deletions modules/electrophysiology_uploader/jsx/UploadForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export default function UploadForm(props) {
type: 'success',
}).then((result) => {
if (result.value) {
props.refreshPage();
// Force a reload of the page to the browse tab.
// A manual reload is used because simply changing the anchor of the
// URL does not reload the page.
window.history.replaceState(null, '', props.browseURL);
window.location.reload();
}
});

Expand Down Expand Up @@ -309,8 +313,8 @@ export default function UploadForm(props) {

UploadForm.propTypes = {
autoLaunch: PropTypes.string,
browseURL: PropTypes.string.isRequired,
uploadURL: PropTypes.string.isRequired,
maxUploadSize: PropTypes.number,
refreshPage: PropTypes.func,
t: PropTypes.func,
};
Loading