bigbuffet-rw/app/soapbox/reducers/onboarding.ts

23 lines
612 B
TypeScript
Raw Normal View History

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
2022-05-02 13:55:52 -07:00
}
const initialState: OnboardingState = {
needsOnboarding: false,
};
export default function onboarding(state: OnboardingState = initialState, action: OnboardingActions): OnboardingState {
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
}
}