Skip to content
Snippets Groups Projects
Unverified Commit 701b0df8 authored by Tom Robinson's avatar Tom Robinson
Browse files

Ensure back button skips forms. Resolves #4055

parent d70c2f59
Branches
Tags
No related merge requests found
import { createAction, createThunkAction, handleActions, combineReducers } from "metabase/lib/redux";
import { reset } from 'redux-form';
import { push } from "react-router-redux";
import { replace } from "react-router-redux";
import Urls from "metabase/lib/urls";
import _ from "underscore";
......@@ -37,7 +37,8 @@ export const saveCollection = createThunkAction(SAVE_COLLECTION, (collection) =>
if (response.id != null) {
dispatch(reset("collection"));
}
dispatch(push(Urls.collection(response)));
// use `replace` so form url doesn't appear in history
dispatch(replace(Urls.collection(response)));
return response;
} catch (e) {
// redux-form expects an object with either { field: error } or { _error: error }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment