2018-01-20 00:32:37 +00:00
|
|
|
import { changeSetting, saveSettings } from './settings';
|
2020-10-12 22:37:21 +00:00
|
|
|
import { requestBrowserPermission } from './notifications';
|
2018-01-20 00:32:37 +00:00
|
|
|
|
2018-12-17 10:07:17 +00:00
|
|
|
export const INTRODUCTION_VERSION = 20181216044202;
|
2018-01-20 00:32:37 +00:00
|
|
|
|
2018-12-17 10:07:17 +00:00
|
|
|
export const closeOnboarding = () => dispatch => {
|
|
|
|
dispatch(changeSetting(['introductionVersion'], INTRODUCTION_VERSION));
|
|
|
|
dispatch(saveSettings());
|
2020-10-12 22:37:21 +00:00
|
|
|
|
|
|
|
dispatch(requestBrowserPermission((permission) => {
|
|
|
|
if (permission === 'granted') {
|
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'follow'], true));
|
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'favourite'], true));
|
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'reblog'], true));
|
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'mention'], true));
|
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'poll'], true));
|
2020-10-15 14:24:47 +00:00
|
|
|
dispatch(changeSetting(['notifications', 'alerts', 'status'], true));
|
2020-10-12 22:37:21 +00:00
|
|
|
dispatch(saveSettings());
|
|
|
|
}
|
|
|
|
}));
|
2018-01-20 00:32:37 +00:00
|
|
|
};
|