Use upstream's settings for CW auto-expand and column swiping (#1770)

* Use Mastodon server-side settings for automatically expanding toots with CWs

* Add modal warning about settings changes

* Use Mastodon server-side settings for disabling swiping
This commit is contained in:
Claire
2022-05-15 17:30:40 +02:00
committed by GitHub
parent aa08399e6f
commit dc350be6f5
20 changed files with 396 additions and 24 deletions

View File

@@ -3,13 +3,12 @@ import { Map as ImmutableMap } from 'immutable';
// Our imports.
import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
import { LOCAL_SETTING_CHANGE } from 'flavours/glitch/actions/local_settings';
import { LOCAL_SETTING_CHANGE, LOCAL_SETTING_DELETE } from 'flavours/glitch/actions/local_settings';
const initialState = ImmutableMap({
layout : 'auto',
stretch : true,
navbar_under : false,
swipe_to_change_columns: true,
side_arm : 'none',
side_arm_reply_mode : 'keep',
show_reply_count : false,
@@ -26,7 +25,6 @@ const initialState = ImmutableMap({
tag_misleading_links: true,
rewrite_mentions: 'no',
content_warnings : ImmutableMap({
auto_unfold : false,
filter : null,
}),
collapsed : ImmutableMap({
@@ -66,6 +64,8 @@ export default function localSettings(state = initialState, action) {
return hydrate(state, action.state.get('local_settings'));
case LOCAL_SETTING_CHANGE:
return state.setIn(action.key, action.value);
case LOCAL_SETTING_DELETE:
return state.deleteIn(action.key);
default:
return state;
}