From 2b9c102f079e83933d1291695632238858bc5401 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 9 Oct 2019 22:27:49 +0100
Subject: [PATCH 1/3] SettingsFlag always run ToggleSwitch fully-controlled
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/elements/SettingsFlag.js | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/components/views/elements/SettingsFlag.js b/src/components/views/elements/SettingsFlag.js
index e4df15a096..f557690514 100644
--- a/src/components/views/elements/SettingsFlag.js
+++ b/src/components/views/elements/SettingsFlag.js
@@ -62,13 +62,6 @@ module.exports = createReactClass({
},
render: function() {
- const value = this.props.manualSave ? this.state.value : SettingsStore.getValueAt(
- this.props.level,
- this.props.name,
- this.props.roomId,
- this.props.isExplicit,
- );
-
const canChange = SettingsStore.canSetValue(this.props.name, this.props.roomId, this.props.level);
let label = this.props.label;
@@ -78,7 +71,7 @@ module.exports = createReactClass({
return (
{label}
-
+
);
},
From 685c2f494a2a4b55266a34e640a89f415e080f6f Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 9 Oct 2019 22:33:14 +0100
Subject: [PATCH 2/3] actually always run fully controlled
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/elements/SettingsFlag.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/views/elements/SettingsFlag.js b/src/components/views/elements/SettingsFlag.js
index f557690514..b4f372073c 100644
--- a/src/components/views/elements/SettingsFlag.js
+++ b/src/components/views/elements/SettingsFlag.js
@@ -48,7 +48,7 @@ module.exports = createReactClass({
if (this.props.group && !checked) return;
if (!this.props.manualSave) this.save(checked);
- else this.setState({ value: checked });
+ this.setState({ value: checked });
if (this.props.onChange) this.props.onChange(checked);
},
From 0d42b8629ea1d0f488c29df754582648294fac45 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 9 Oct 2019 23:20:59 +0100
Subject: [PATCH 3/3] remove SettingsFlag manualSave altogether
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/elements/SettingsFlag.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/components/views/elements/SettingsFlag.js b/src/components/views/elements/SettingsFlag.js
index b4f372073c..a3a6d18d33 100644
--- a/src/components/views/elements/SettingsFlag.js
+++ b/src/components/views/elements/SettingsFlag.js
@@ -30,7 +30,6 @@ module.exports = createReactClass({
label: PropTypes.string, // untranslated
onChange: PropTypes.func,
isExplicit: PropTypes.bool,
- manualSave: PropTypes.bool,
},
getInitialState: function() {
@@ -47,7 +46,7 @@ module.exports = createReactClass({
onChange: function(checked) {
if (this.props.group && !checked) return;
- if (!this.props.manualSave) this.save(checked);
+ this.save(checked);
this.setState({ value: checked });
if (this.props.onChange) this.props.onChange(checked);
},