|
|
@ -39,6 +39,8 @@ import {
|
|
|
|
import { TIMELINE_DELETE } from '../actions/timelines';
|
|
|
|
import { TIMELINE_DELETE } from '../actions/timelines';
|
|
|
|
import { STORE_HYDRATE } from '../actions/store';
|
|
|
|
import { STORE_HYDRATE } from '../actions/store';
|
|
|
|
import { REDRAFT } from '../actions/statuses';
|
|
|
|
import { REDRAFT } from '../actions/statuses';
|
|
|
|
|
|
|
|
import { ME_FETCH_SUCCESS } from '../actions/me';
|
|
|
|
|
|
|
|
import { SETTING_CHANGE, FE_NAME } from '../actions/settings';
|
|
|
|
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
|
|
|
|
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
|
|
|
|
import uuid from '../uuid';
|
|
|
|
import uuid from '../uuid';
|
|
|
|
import { unescapeHTML } from '../utils/html';
|
|
|
|
import { unescapeHTML } from '../utils/html';
|
|
|
@ -368,6 +370,16 @@ export default function compose(state = initialState, action) {
|
|
|
|
return state.updateIn(['poll', 'options'], options => options.delete(action.index));
|
|
|
|
return state.updateIn(['poll', 'options'], options => options.delete(action.index));
|
|
|
|
case COMPOSE_POLL_SETTINGS_CHANGE:
|
|
|
|
case COMPOSE_POLL_SETTINGS_CHANGE:
|
|
|
|
return state.update('poll', poll => poll.set('expires_in', action.expiresIn).set('multiple', action.isMultiple));
|
|
|
|
return state.update('poll', poll => poll.set('expires_in', action.expiresIn).set('multiple', action.isMultiple));
|
|
|
|
|
|
|
|
case ME_FETCH_SUCCESS:
|
|
|
|
|
|
|
|
const me = fromJS(action.me);
|
|
|
|
|
|
|
|
const defaultPrivacy = me.getIn(['pleroma', 'settings_store', FE_NAME, 'defaultPrivacy']);
|
|
|
|
|
|
|
|
if (!defaultPrivacy) return state;
|
|
|
|
|
|
|
|
return state.set('default_privacy', defaultPrivacy).set('privacy', defaultPrivacy);
|
|
|
|
|
|
|
|
case SETTING_CHANGE:
|
|
|
|
|
|
|
|
const pathString = action.path.join(',');
|
|
|
|
|
|
|
|
if (pathString === 'defaultPrivacy')
|
|
|
|
|
|
|
|
return state.set('default_privacy', action.value).set('privacy', action.value);
|
|
|
|
|
|
|
|
return state;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|