2017-06-24 22:12:34 -04:00
|
|
|
export const LOCAL_SETTING_CHANGE = 'LOCAL_SETTING_CHANGE';
|
|
|
|
|
|
|
|
export function changeLocalSetting(key, value) {
|
|
|
|
return dispatch => {
|
|
|
|
dispatch({
|
|
|
|
type: LOCAL_SETTING_CHANGE,
|
|
|
|
key,
|
|
|
|
value,
|
|
|
|
});
|
|
|
|
|
|
|
|
dispatch(saveLocalSettings());
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export function saveLocalSettings() {
|
|
|
|
return (_, getState) => {
|
2017-06-29 01:00:54 -04:00
|
|
|
const localSettings = getState().get('local_settings').toJS();
|
2017-06-24 22:12:34 -04:00
|
|
|
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
|
|
|
};
|
|
|
|
};
|