Go back on successful save.

master
Tom Hacohen 7 years ago
parent 0c9dfd7087
commit cfd6db6fb5

@ -32,6 +32,7 @@ class Pim extends React.Component {
journals: JournalsData;
entries: EntriesType;
match: any;
history: any;
};
constructor(props: any) {
@ -52,7 +53,10 @@ class Pim extends React.Component {
return;
}
store.dispatch(createJournalEntry(this.props.etesync, journal, entries.value, event.toIcal()));
let saveEvent = store.dispatch(createJournalEntry(this.props.etesync, journal, entries.value, event.toIcal()));
(saveEvent as any).then(() => {
this.props.history.goBack();
});
}
render() {

@ -68,8 +68,14 @@ class SyncGate extends React.Component {
/>
<Route
path={routeResolver.getRoute('pim')}
render={({match}) => (
<Pim etesync={this.props.etesync} journals={journals} entries={this.props.entries} match={match} />
render={({match, history}) => (
<Pim
etesync={this.props.etesync}
journals={journals}
entries={this.props.entries}
match={match}
history={history}
/>
)}
/>
<Route

Loading…
Cancel
Save