🎨 Small code cleanup

This commit is contained in:
Philipp Stracker 2024-11-21 17:42:48 +01:00
parent 3fa823ee02
commit 454e7c1a6d
No known key found for this signature in database
2 changed files with 14 additions and 60 deletions

View file

@ -101,11 +101,9 @@ export const setClientSecret = ( clientSecret ) => ( {
* @return {Action} The action.
*/
export const persist = function* () {
yield setIsBusy( true );
yield {
type: ACTION_TYPES.DO_PERSIST_DATA,
};
yield setIsBusy( false );
const data = yield select( STORE_NAME ).persistentData();
yield { type: ACTION_TYPES.DO_PERSIST_DATA, data };
};
/**

View file

@ -25,17 +25,6 @@ import { STORE_NAME } from './constants';
*/
export const reset = () => ( { type: ACTION_TYPES.RESET } );
/**
* Transient. Marks the onboarding details as "ready", i.e., fully initialized.
*
* @param {boolean} isReady
* @return {Action} The action.
*/
export const setIsReady = ( isReady ) => ( {
type: ACTION_TYPES.SET_TRANSIENT,
payload: { isReady },
} );
/**
* Persistent. Set the full onboarding details, usually during app initialization.
*
@ -47,6 +36,17 @@ export const hydrate = ( payload ) => ( {
payload,
} );
/**
* Transient. Marks the onboarding details as "ready", i.e., fully initialized.
*
* @param {boolean} isReady
* @return {Action} The action.
*/
export const setIsReady = ( isReady ) => ( {
type: ACTION_TYPES.SET_TRANSIENT,
payload: { isReady },
} );
/**
* Persistent.Set the "onboarding completed" flag which shows or hides the wizard.
*
@ -69,50 +69,6 @@ export const setStep = ( step ) => ( {
payload: { step },
} );
/**
* Persistent. Sets the sandbox mode on or off.
*
* @param {boolean} useSandbox
* @return {Action} The action.
*/
export const setSandboxMode = ( useSandbox ) => ( {
type: ACTION_TYPES.SET_PERSISTENT,
payload: { useSandbox },
} );
/**
* Persistent. Toggles the "Manual Connection" mode on or off.
*
* @param {boolean} useManualConnection
* @return {Action} The action.
*/
export const setManualConnectionMode = ( useManualConnection ) => ( {
type: ACTION_TYPES.SET_PERSISTENT,
payload: { useManualConnection },
} );
/**
* Persistent. Changes the "client ID" value.
*
* @param {string} clientId
* @return {Action} The action.
*/
export const setClientId = ( clientId ) => ( {
type: ACTION_TYPES.SET_PERSISTENT,
payload: { clientId },
} );
/**
* Persistent. Changes the "client secret" value.
*
* @param {string} clientSecret
* @return {Action} The action.
*/
export const setClientSecret = ( clientSecret ) => ( {
type: ACTION_TYPES.SET_PERSISTENT,
payload: { clientSecret },
} );
/**
* Persistent. Sets the "isCasualSeller" value.
*