🎨 Reorganize code

This commit is contained in:
Philipp Stracker 2024-10-23 18:14:25 +02:00
parent e4430996ca
commit e20a6fdbce
No known key found for this signature in database
2 changed files with 12 additions and 7 deletions

View file

@ -1,6 +1,9 @@
export default {
SET_ONBOARDING_DETAILS: 'SET_ONBOARDING_DETAILS',
// Transient data.
SET_IS_SAVING_ONBOARDING_DETAILS: 'SET_IS_SAVING_ONBOARDING_DETAILS',
// Persistent data.
SET_ONBOARDING_DETAILS: 'SET_ONBOARDING_DETAILS',
SET_ONBOARDING_STEP: 'SET_ONBOARDING_STEP',
SET_SANDBOX_MODE: 'SET_SANDBOX_MODE',
SET_MANUAL_CONNECTION_MODE: 'SET_MANUAL_CONNECTION_MODE',

View file

@ -14,18 +14,20 @@ export const onboardingReducer = (
{ type, ...action }
) => {
switch ( type ) {
case ACTION_TYPES.SET_ONBOARDING_DETAILS:
return {
...state,
data: action.payload,
};
// Transient data.
case ACTION_TYPES.SET_IS_SAVING_ONBOARDING_DETAILS:
return {
...state,
isSaving: action.isSaving,
};
// Persistent data.
case ACTION_TYPES.SET_ONBOARDING_DETAILS:
return {
...state,
data: action.payload,
};
case ACTION_TYPES.SET_ONBOARDING_STEP:
return {
...state,