From 3801f0b78ecc149820cff3438b4b96d38b42b0d8 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 17 Jul 2019 14:47:10 +0100 Subject: [PATCH 1/2] Enable reactions and edits by default This enables reactions and edits by default, assuming you don't have any local device settings that would disable them. Fixes https://github.com/vector-im/riot-web/issues/10281 --- src/settings/Settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 2ce1b1aa4e..f07cf891b9 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -118,13 +118,13 @@ export const SETTINGS = { isFeature: true, displayName: _td("Edit messages after they have been sent (refresh to apply changes)"), supportedLevels: LEVELS_FEATURE, - default: false, + default: true, }, "feature_reactions": { isFeature: true, displayName: _td("React to messages with emoji (refresh to apply changes)"), supportedLevels: LEVELS_FEATURE, - default: false, + default: true, }, "MessageComposerInput.suggestEmoji": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, From 202f6fb94d91a42d864431176984b4e6c6294a81 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 17 Jul 2019 14:48:14 +0100 Subject: [PATCH 2/2] Continue to next config level after device for features This ensures we continue checking further config levels for the feature setting if nothing is found when reading the device level. For example, this means the feature setting's default value can be used. --- src/settings/handlers/DeviceSettingsHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/settings/handlers/DeviceSettingsHandler.js b/src/settings/handlers/DeviceSettingsHandler.js index b5c4382768..780815efd1 100644 --- a/src/settings/handlers/DeviceSettingsHandler.js +++ b/src/settings/handlers/DeviceSettingsHandler.js @@ -122,7 +122,10 @@ export default class DeviceSettingsHandler extends SettingsHandler { } const value = localStorage.getItem("mx_labs_feature_" + featureName); - return value === "true"; + if (value === "true") return true; + if (value === "false") return false; + // Try to read the next config level for the feature. + return null; } _writeFeature(featureName, enabled) {