mirror of
https://github.com/urbit/shrub.git
synced 2024-11-27 18:34:48 +03:00
CalmPref: respect inverted form state
This commit is contained in:
parent
133b80e496
commit
3907b96112
@ -23,14 +23,14 @@ interface FormSchema {
|
||||
}
|
||||
|
||||
const settingsSel = (s: SettingsState): FormSchema => ({
|
||||
hideAvatars: s.calm.hideAvatars,
|
||||
hideNicknames: s.calm.hideNicknames,
|
||||
hideUnreads: s.calm.hideUnreads,
|
||||
hideGroups: s.calm.hideGroups,
|
||||
hideUtilities: s.calm.hideUtilities,
|
||||
imageShown: !s.remoteContentPolicy.imageShown,
|
||||
videoShown: !s.remoteContentPolicy.videoShown,
|
||||
oembedShown: !s.remoteContentPolicy.oembedShown,
|
||||
hideAvatars: s.calm.hideAvatars,
|
||||
hideNicknames: s.calm.hideNicknames,
|
||||
hideUnreads: s.calm.hideUnreads,
|
||||
hideGroups: s.calm.hideGroups,
|
||||
hideUtilities: s.calm.hideUtilities,
|
||||
imageShown: !s.remoteContentPolicy.imageShown,
|
||||
videoShown: !s.remoteContentPolicy.videoShown,
|
||||
oembedShown: !s.remoteContentPolicy.oembedShown,
|
||||
audioShown: !s.remoteContentPolicy.audioShown
|
||||
});
|
||||
|
||||
@ -42,7 +42,7 @@ export function CalmPrefs() {
|
||||
_.forEach(v, (bool, key) => {
|
||||
const bucket = ['imageShown', 'videoShown', 'audioShown', 'oembedShown'].includes(key) ? 'remoteContentPolicy' : 'calm';
|
||||
if(initialValues[key] !== bool) {
|
||||
putEntry(bucket, key, bool);
|
||||
putEntry(bucket, key, bucket === 'calm' ? bool : !bool);
|
||||
}
|
||||
});
|
||||
}, [initialValues]);
|
||||
|
Loading…
Reference in New Issue
Block a user