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
9 changes: 8 additions & 1 deletion src/layouts/summit-id-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ const SummitIdLayout = ({ currentSummit, loading, match, ...props }) => {
path={`${match.url}/dashboard`}
component={SummitDashboardPage}
/>
<Route strict exact path={match.url} component={EditSummitPage} />
<Route
strict
exact
path={match.url}
render={(props) => (
<EditSummitPage {...props} summitId={match.params.summit_id} />
)}
/>
<Route
path={`${match.url}/room-booking-attributes`}
component={RoomBookingAttributeLayout}
Expand Down
15 changes: 13 additions & 2 deletions src/pages/summits/edit-summit-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,24 @@ class EditSummitPage extends React.Component {
}

componentDidMount() {
const { currentSummit } = this.props;
const { summitId, resetSummitForm } = this.props;

if (currentSummit?.id) {
if (summitId) {
this.props.getUserRolesBySummit();
this.props.getMarketingSettingsForRegLite();
this.props.getMarketingSettingsForPrintApp();
this.props.getRegFeedMetadataBySummit();
} else {
resetSummitForm();
}
}

componentDidUpdate(prevProps) {
const oldId = prevProps.summitId;
const newId = this.props.summitId;

if (newId !== oldId && !newId) {
this.props.resetSummitForm();
}
}

Expand Down
Loading