You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
478 B
21 lines
478 B
8 years ago
|
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) => {
|
||
8 years ago
|
const localSettings = getState().get('local_settings').toJS();
|
||
8 years ago
|
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
||
|
};
|
||
|
};
|