-
-
Notifications
You must be signed in to change notification settings - Fork 831
Conversation
ac97e93
to
cbc994e
Compare
cbc994e
to
a4fae31
Compare
This was basically the same as `SettingsStore.canSetValue` only more confusing, so let's get rid of it.
The current magic where this only works for features (but not beta features!) is, well, magical. And I need more flexibility here.
I don't know if this was ever intended to have different semantics to `LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG`, but if it was, those semantics shuold have been written down. They now seem to be used entirely interchangably.
a4fae31
to
92cd467
Compare
|
||
const label = this.props.label ?? SettingsStore.getDisplayName(this.props.name, this.props.level); | ||
const description = SettingsStore.getDescription(this.props.name); | ||
const shouldWarn = SettingsStore.shouldHaveWarning(this.props.name); | ||
const disabled = this.state.disabled || !canChange; |
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.
note that it was impossible for canChange
to be true while state.disabled
was true, so this was equivalent to const disabled = !canChange;
.
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.
A question :)
@@ -62,7 +62,7 @@ export default class CryptographyPanel extends React.Component<IProps, IState> { | |||
} | |||
|
|||
let noSendUnverifiedSetting: JSX.Element | undefined; | |||
if (SettingsStore.isEnabled("blacklistUnverifiedDevices")) { | |||
if (SettingsStore.canSetValue("blacklistUnverifiedDevices", null, SettingLevel.DEVICE)) { |
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.
This line is at true
if we can set the blacklistUnverifiedDevices
settings on this device ?
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.
Yes. Which makes sense, because that's what's going to happen when you toggle the SettingsFlag
.
Follow-up on #12125
A few cleanups; suggest reviewing commit-by-commit.
The changes are, approximately:
SettingsStore.isEnabled
andSettingsStore.canSetValue
. Having two methods which do nearly-but-not-quite the same thing is confusing, and there's no good reason to have both.Settings.configDisablesSetting
to replace the magic where this works for a magic subset of settings.LEVELS_FEATURE
with the identical but more descriptiveLEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG
.This change is marked as an internal change (Task), so will not be included in the changelog.