From db1401f48444b08780b1709d67c43f03403e72e3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 27 Apr 2018 11:19:14 +0100 Subject: [PATCH] Pass false to onFinished from BaseDialog Everywhere else, onFinished takes a boolean indicating whether the dialog was confirmed on cancelled, and had function that were expecting this variable and getting undefined. --- src/components/views/dialogs/BaseDialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 21a2477c37..7959e7cb10 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -36,6 +36,9 @@ export default React.createClass({ propTypes: { // onFinished callback to call when Escape is pressed + // Take a boolean which is true is the dialog was dismissed + // with a positive / confirm action or false if it was + // cancelled (from BaseDialog, this is always false). onFinished: PropTypes.func.isRequired, // called when a key is pressed @@ -77,12 +80,12 @@ export default React.createClass({ if (e.keyCode === KeyCode.ESCAPE) { e.stopPropagation(); e.preventDefault(); - this.props.onFinished(); + this.props.onFinished(false); } }, _onCancelClick: function(e) { - this.props.onFinished(); + this.props.onFinished(false); }, render: function() {