-
-
Notifications
You must be signed in to change notification settings - Fork 828
Fix various issues surrounding granular settings to date #1613
Conversation
Signed-off-by: Travis Ralston <travpc@gmail.com>
Otherwise `!null` ends up being "true", therefore forcing URL previews on for everyone. Fixes element-hq/element-web#5607 Signed-off-by: Travis Ralston <travpc@gmail.com>
This shouldn't currently be causing problems, but will in teh future. The bug can be exposed by having a setting where the level order is completely reversed, therefore causing LEVEL_ORDER[0] to actually be the most generic, not the most specific. Instead, we'll pull in the setting's level order and fallback to LEVEL_ORDER, therefore requesting the most specific value. Signed-off-by: Travis Ralston <travpc@gmail.com>
Fixes element-hq/element-web#5611 Signed-off-by: Travis Ralston <travpc@gmail.com>
Otherwise we end up lying and saying notifications are disabled, despite the push rules saying otherwise. Part 1 of the fix for: * element-hq/element-web#5603 * element-hq/element-web#5606 Signed-off-by: Travis Ralston <travpc@gmail.com>
Previously the push rule was ignored, leading to all kinds of interesting issues regarding notifications. This fixes those issues by giving the master push rule the authority it deserves for reasonable defaults. Part 2 of the fix for: * element-hq/element-web#5603 * element-hq/element-web#5606 Signed-off-by: Travis Ralston <travpc@gmail.com>
Signed-off-by: Travis Ralston <travpc@gmail.com>
e37bf6b
to
d0a0a9c
Compare
@@ -613,8 +613,7 @@ module.exports = React.createClass({ | |||
|
|||
onLanguageChange: function(newLang) { | |||
if(this.state.language !== newLang) { | |||
// We intentionally promote this to the account level at this point | |||
SettingsStore.setValue("language", null, SettingLevel.ACCOUNT, newLang); | |||
SettingsStore.setValue("language", null, SettingLevel.DEVICE, newLang); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the inevitable question: I have no idea why this got promoted to an account level setting. It's always been a local setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, i love the idea of changing language on one device magically synchronising over all your accounts :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'love' in a "aaaaaargh no" kinda way
@@ -891,7 +891,7 @@ module.exports = React.createClass({ | |||
*/ | |||
_onSetTheme: function(theme) { | |||
if (!theme) { | |||
theme = this.props.config.default_theme || 'light'; | |||
theme = SettingsStore.getValueAt(SettingLevel.DEFAULT, "theme"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\o/ :D
return false; | ||
} | ||
|
||
// Why enabled == false means "enabled" is beyond me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the masterRule acts to disable push, apparently.
if (!Notifier.isPossible()) return false; | ||
|
||
if (calculatedValue === null) { | ||
console.log(isMasterRuleEnabled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, i assume this is rogue debug
lgtm! |
@@ -40,7 +40,6 @@ export class NotificationsEnabledController extends SettingController { | |||
if (!Notifier.isPossible()) return false; | |||
|
|||
if (calculatedValue === null) { | |||
console.log(isMasterRuleEnabled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops ._.
Partner PRs
Fixes
Description
All of the issues reported are edge cases to the granular settings system in one way or another. Each fix is described in the commit body.
This PR additionally includes a missed case where the default theme should be loaded through
SettingsStore
so that the override procedure is not defined in several places. This is the reason for the riot-web PR.