mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +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,
|
||||
TodosStoreName,
|
||||
} from './index';
|
||||
import { setCompleted } from './onboarding/actions';
|
||||
|
||||
export const addDebugTools = ( context, modules ) => {
|
||||
if ( ! context || ! context?.debug ) {
|
||||
if ( ! context ) {
|
||||
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.
|
||||
context.dumpStore = async () => {
|
||||
/* eslint-disable no-console */
|
||||
|
@ -70,8 +75,12 @@ export const addDebugTools = ( context, modules ) => {
|
|||
// eslint-disable-next-line no-console
|
||||
console.log( `Reset store: ${ storeName }...` );
|
||||
|
||||
store.reset();
|
||||
store.persist();
|
||||
try {
|
||||
store.reset();
|
||||
store.persist();
|
||||
} catch ( error ) {
|
||||
console.error( ' ... Reset failed, skipping this store' );
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue