mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 09:18:06 +01:00
20 lines
477 B
JavaScript
20 lines
477 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('localSettings').toJS();
|
|
localStorage.setItem('mastodon-settings', JSON.stringify(localSettings));
|
|
};
|
|
};
|