From 6e39e72849c348b98d346d274145bf89fcc89c61 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 2 Aug 2017 14:00:24 +0100 Subject: [PATCH] fix m.federate always being false because value is a string. Y HTML... Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 7 ++----- .../views/dialogs/TextInputWithCheckboxDialog.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 22119585d9..5f01b72c2b 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -801,12 +801,9 @@ module.exports = React.createClass({ , onFinished: (shouldCreate, name, noFederate) => { if (shouldCreate) { - const createOpts = { - creation_content: { - "m.federate": !noFederate, - }, - }; + const createOpts = {}; if (name) createOpts.name = name; + if (noFederate) createOpts.creation_content = {'m.federate': false}; createRoom({createOpts}).done(); } }, diff --git a/src/components/views/dialogs/TextInputWithCheckboxDialog.js b/src/components/views/dialogs/TextInputWithCheckboxDialog.js index 613fab4cdb..6fd46ec209 100644 --- a/src/components/views/dialogs/TextInputWithCheckboxDialog.js +++ b/src/components/views/dialogs/TextInputWithCheckboxDialog.js @@ -56,7 +56,7 @@ export default React.createClass({ }, onOk: function() { - this.props.onFinished(true, this.refs.textinput.value, this.refs.checkbox.value); + this.props.onFinished(true, this.refs.textinput.value, this.refs.checkbox.checked); }, onCancel: function() {