mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🧑💻 Enable debug tools on every environment
This commit is contained in:
parent
585b24fe78
commit
1f3049e2eb
1 changed files with 13 additions and 4 deletions
|
@ -6,13 +6,18 @@ import {
|
||||||
StylingStoreName,
|
StylingStoreName,
|
||||||
TodosStoreName,
|
TodosStoreName,
|
||||||
} from './index';
|
} from './index';
|
||||||
import { setCompleted } from './onboarding/actions';
|
|
||||||
|
|
||||||
export const addDebugTools = ( context, modules ) => {
|
export const addDebugTools = ( context, modules ) => {
|
||||||
if ( ! context || ! context?.debug ) {
|
if ( ! context ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO - enable this condition for version 3.0.1
|
||||||
|
// In version 3.0.0 we want to have the debug tools available on every installation
|
||||||
|
if ( ! context.debug ) { return }
|
||||||
|
*/
|
||||||
|
|
||||||
// Dump the current state of all our Redux stores.
|
// Dump the current state of all our Redux stores.
|
||||||
context.dumpStore = async () => {
|
context.dumpStore = async () => {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
@ -70,8 +75,12 @@ export const addDebugTools = ( context, modules ) => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log( `Reset store: ${ storeName }...` );
|
console.log( `Reset store: ${ storeName }...` );
|
||||||
|
|
||||||
store.reset();
|
try {
|
||||||
store.persist();
|
store.reset();
|
||||||
|
store.persist();
|
||||||
|
} catch ( error ) {
|
||||||
|
console.error( ' ... Reset failed, skipping this store' );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue