mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
🧑💻 Correct debug method to reset all stores
This commit is contained in:
parent
51db2de840
commit
405c397331
1 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
import { OnboardingStoreName } from './index';
|
||||
import { OnboardingStoreName, CommonStoreName } from './index';
|
||||
|
||||
export const addDebugTools = ( context, modules ) => {
|
||||
if ( ! context || ! context?.debug ) {
|
||||
|
@ -33,9 +33,14 @@ export const addDebugTools = ( context, modules ) => {
|
|||
};
|
||||
|
||||
context.resetStore = () => {
|
||||
const onboarding = wp.data.dispatch( OnboardingStoreName );
|
||||
onboarding.reset();
|
||||
onboarding.persist();
|
||||
const stores = [ OnboardingStoreName, CommonStoreName ];
|
||||
|
||||
stores.forEach( ( storeName ) => {
|
||||
const store = wp.data.dispatch( storeName );
|
||||
|
||||
store.reset();
|
||||
store.persist();
|
||||
} );
|
||||
};
|
||||
|
||||
context.startOnboarding = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue