Refetch registered channels after installing channel in Campaigns card.

This commit is contained in:
Gan Eng Chin 2023-03-03 02:34:16 +08:00
parent ec15697d44
commit 913f7176b2
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,11 @@ import classnames from 'classnames';
/**
* Internal dependencies
*/
import { useRecommendedChannels, useNewCampaignTypes } from '~/marketing/hooks';
import {
useRecommendedChannels,
useNewCampaignTypes,
useRegisteredChannels,
} from '~/marketing/hooks';
import { SmartPluginCardBody } from '~/marketing/components';
import './CreateNewCampaignModal.scss';
@ -38,6 +42,7 @@ export const CreateNewCampaignModal = ( props: CreateCampaignModalProps ) => {
const [ collapsed, setCollapsed ] = useState( true );
const { data: newCampaignTypes } = useNewCampaignTypes();
const { data: recommendedChannels } = useRecommendedChannels();
const { refetch } = useRegisteredChannels();
return (
<Modal
@ -140,8 +145,7 @@ export const CreateNewCampaignModal = ( props: CreateCampaignModalProps ) => {
<SmartPluginCardBody
plugin={ el }
onInstalledAndActivated={
// TODO: check what to do here.
() => {}
refetch
}
/>
{ idx !==