about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/onboarding.js
blob: a161c50efed4858811d93ba44a92d600ac40fd8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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());
    }
  };
};