2022-05-02 13:55:52 -07:00
|
|
|
import { ONBOARDING_START, ONBOARDING_END } from 'soapbox/actions/onboarding';
|
|
|
|
|
|
|
|
import type { OnboardingActions } from 'soapbox/actions/onboarding';
|
|
|
|
|
|
|
|
type OnboardingState = {
|
|
|
|
needsOnboarding: boolean,
|
|
|
|
}
|
|
|
|
|
|
|
|
const initialState: OnboardingState = {
|
|
|
|
needsOnboarding: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function onboarding(state: OnboardingState = initialState, action: OnboardingActions): OnboardingState {
|
2022-05-11 10:40:34 -07:00
|
|
|
switch (action.type) {
|
2022-05-11 14:06:35 -07:00
|
|
|
case ONBOARDING_START:
|
|
|
|
return { ...state, needsOnboarding: true };
|
|
|
|
case ONBOARDING_END:
|
|
|
|
return { ...state, needsOnboarding: false };
|
|
|
|
default:
|
|
|
|
return state;
|
2022-05-02 13:55:52 -07:00
|
|
|
}
|
|
|
|
}
|