bigbuffet-rw/app/soapbox/actions/push_notifications/index.ts

26 lines
516 B
TypeScript
Raw Normal View History

import { register, saveSettings } from './registerer';
2020-03-27 13:59:38 -07:00
import {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
setAlerts,
} from './setter';
import type { AppDispatch } from 'soapbox/store';
2020-03-27 13:59:38 -07:00
export {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
register,
changeAlerts,
2020-03-27 13:59:38 -07:00
};
const changeAlerts = (path: Array<string>, value: any) =>
(dispatch: AppDispatch) => {
2020-03-27 13:59:38 -07:00
dispatch(setAlerts(path, value));
dispatch(saveSettings() as any);
2020-03-27 13:59:38 -07:00
};