mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
21 lines
478 B
JavaScript
21 lines
478 B
JavaScript
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) => {
|
|
const localSettings = getState().get('local_settings').toJS();
|
|
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
|
};
|
|
};
|