catstodon/app/javascript/mastodon/actions/onboarding.js

15 lines
403 B
JavaScript
Raw Normal View History

2017-11-18 04:16:35 +01:00
import { openModal } from './modal';
import { changeSetting, saveSettings } from './settings';
export function showOnboardingOnce() {
return (dispatch, getState) => {
const alreadySeen = getState().getIn(['settings', 'onboarded']);
if (!alreadySeen) {
dispatch(openModal('ONBOARDING'));
dispatch(changeSetting(['onboarded'], true));
dispatch(saveSettings());
}
};
};