Skip to content
Snippets Groups Projects
Commit 9a3f31aa authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Fix the save button UI quirk in question saving modal

parent 8ffd45f3
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@ import Button from "metabase/components/Button";
import CollectionList from "metabase/questions/containers/CollectionList";
import Query from "metabase/lib/query";
import { cancelable } from "metabase/lib/promise";
import { t } from 'c-3po';
import "./SaveQuestionModal.css";
import ButtonWithStatus from "metabase/components/ButtonWithStatus";
......@@ -53,12 +52,6 @@ export default class SaveQuestionModal extends Component {
this.validateForm();
}
componentWillUnmount() {
if (this.requestPromise) {
this.requestPromise.cancel();
}
}
validateForm() {
let { details } = this.state;
......@@ -110,14 +103,12 @@ export default class SaveQuestionModal extends Component {
};
if (details.saveType === "create") {
this.requestPromise = cancelable(createFn(card));
await createFn(card);
} else if (details.saveType === "overwrite") {
card.id = this.props.originalCard.id;
this.requestPromise = cancelable(saveFn(card));
await saveFn(card);
}
await this.requestPromise;
this.requestPromise = null;
this.props.onClose();
} catch (error) {
if (error && !error.isCanceled) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment