about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/onboarding.js
blob: 5038b7eb670b6ecb5c642ed9f72149c1f2a8bb59 (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());
    }
  };
}