Add “manual connection busy” state

This commit is contained in:
Philipp Stracker 2024-11-04 16:48:59 +01:00
parent d5745709d8
commit b3e25ace3f
No known key found for this signature in database
3 changed files with 18 additions and 0 deletions

View file

@ -4,6 +4,7 @@ export default {
// Transient data.
SET_ONBOARDING_IS_READY: 'SET_ONBOARDING_IS_READY',
SET_IS_SAVING_ONBOARDING: 'SET_IS_SAVING_ONBOARDING',
SET_MANUAL_CONNECTION_BUSY: 'SET_MANUAL_CONNECTION_BUSY',
// Persistent data.
SET_ONBOARDING_COMPLETED: 'SET_ONBOARDING_COMPLETED',

View file

@ -38,6 +38,19 @@ export const setIsSaving = ( isSaving ) => {
};
};
/**
* Non-persistent. Changes the "manual connection is busy" flag.
*
* @param {boolean} isBusy
* @return {{type: string, isBusy}} The action.
*/
export const setManualConnectionIsBusy = ( isBusy ) => {
return {
type: ACTION_TYPES.SET_IS_SAVING_ONBOARDING,
isBusy,
};
};
/**
* Persistent. Set the full onboarding details, usually during app initialization.
*

View file

@ -3,6 +3,7 @@ import ACTION_TYPES from './action-types';
const defaultState = {
isReady: false,
isSaving: false,
isManualConnectionBusy: false,
// Data persisted to the server.
data: {
@ -59,6 +60,9 @@ export const onboardingReducer = (
case ACTION_TYPES.SET_IS_SAVING_ONBOARDING:
return setTransient( { isSaving: action.isSaving } );
case ACTION_TYPES.SET_MANUAL_CONNECTION_BUSY:
return setTransient( { isManualConnectionBusy: action.isBusy } );
// Persistent data.
case ACTION_TYPES.SET_ONBOARDING_DETAILS:
const newState = setPersistent( action.payload.data );