Skip to content
Permalink
Browse files

Fix bug where modal errors persisted

  • Loading branch information...
upvalue committed Apr 20, 2019
1 parent b96328d commit baa966ee1930352c0c02cf9bdf67d04480db20f5
Showing with 2 additions and 13 deletions.
  1. +2 −13 frontend/common/modal.tsx
@@ -108,18 +108,6 @@ export class ModalProvider extends React.Component<ModalProviderProps, ModalStat
};
}

/*
componentWillUpdate(nextProps : ModalProviderProps, nextState: ModalState) {
if (this.state.modalOpen && !nextState.modalOpen) {
mousetrap.unbind(KEYSEQ_MODAL_EXIT);
} else if (!this.state.modalOpen && nextState.modalOpen) {
mousetrap.bindGlobal('escape', () => {
console.log('quit modal');
});
}
}
*/

openModalPrompt(body: string, ok: string, callback: (result: string) => void,
defaultValue?: string, options?: ModalPromptOptions) {

@@ -174,7 +162,7 @@ export class ModalProvider extends React.Component<ModalProviderProps, ModalStat
}

dismissModal = () => {
this.setState({ modalOpen: false });
this.setState({ modalOpen: false, modalError: undefined });
}

submitModal = (e: React.FormEvent<HTMLFormElement> | React.MouseEvent<HTMLButtonElement>) => {
@@ -208,6 +196,7 @@ export class ModalProvider extends React.Component<ModalProviderProps, ModalStat

this.setState({
modalOpen: false,
modalError: undefined,
});
}

0 comments on commit baa966e

Please sign in to comment.
You can’t perform that action at this time.