diff --git a/modules/ppcp-settings/resources/js/data/debug.js b/modules/ppcp-settings/resources/js/data/debug.js index ed3233116..e9bd1295e 100644 --- a/modules/ppcp-settings/resources/js/data/debug.js +++ b/modules/ppcp-settings/resources/js/data/debug.js @@ -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' ); + } } ); };