Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit 83266f1

Browse files
committed
Moved invalidateResolutionForStoreSelector into OBW
1 parent 02ee720 commit 83266f1

File tree

2 files changed

+16
-10
lines changed
  • client

2 files changed

+16
-10
lines changed

client/homescreen/activity-panel/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* External dependencies
33
*/
4-
import { useDispatch, useSelect } from '@wordpress/data';
4+
import { useSelect } from '@wordpress/data';
55
import { Badge } from '@woocommerce/components';
66
import {
77
Button,
@@ -56,17 +56,10 @@ export const ActivityPanel = () => {
5656
};
5757
} );
5858

59-
const { invalidateResolutionForStoreSelector } = useDispatch(
60-
ONBOARDING_STORE_NAME
61-
);
62-
6359
const panels = getAllPanels( panelsData );
6460

6561
useEffect( () => {
6662
if ( panelsData.isTaskListHidden !== undefined ) {
67-
if ( ! panelsData.isTaskListHidden ) {
68-
invalidateResolutionForStoreSelector( 'getTaskLists' );
69-
}
7063
const visiblePanels = panels.reduce(
7164
( acc, panel ) => {
7265
const panelId = snakeCase( panel.id );

client/profile-wizard/steps/store-details/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@ class StoreDetails extends Component {
230230
isStoreDetailsPopoverVisible,
231231
isSkipSetupPopoverVisible,
232232
} = this.state;
233-
const { skipProfiler, isLoading, isBusy, initialValues } = this.props;
233+
const {
234+
skipProfiler,
235+
isLoading,
236+
isBusy,
237+
initialValues,
238+
invalidateResolutionForStoreSelector,
239+
} = this.props;
234240

235241
/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
236242
const skipSetupText = __(
@@ -390,6 +396,9 @@ class StoreDetails extends Component {
390396
isLink
391397
className="woocommerce-profile-wizard__footer-link"
392398
onClick={ () => {
399+
invalidateResolutionForStoreSelector(
400+
'getTaskLists'
401+
);
393402
this.setState( {
394403
showUsageModal: true,
395404
skipping: true,
@@ -498,13 +507,17 @@ export default compose(
498507
} ),
499508
withDispatch( ( dispatch ) => {
500509
const { createNotice } = dispatch( 'core/notices' );
501-
const { updateProfileItems } = dispatch( ONBOARDING_STORE_NAME );
510+
const {
511+
invalidateResolutionForStoreSelector,
512+
updateProfileItems,
513+
} = dispatch( ONBOARDING_STORE_NAME );
502514
const { updateAndPersistSettingsForGroup } = dispatch(
503515
SETTINGS_STORE_NAME
504516
);
505517

506518
return {
507519
createNotice,
520+
invalidateResolutionForStoreSelector,
508521
updateProfileItems,
509522
updateAndPersistSettingsForGroup,
510523
};

0 commit comments

Comments
 (0)