diff --git a/packages/console/src/pages/ConnectorDetails/ConnectorContent/index.tsx b/packages/console/src/pages/ConnectorDetails/ConnectorContent/index.tsx index b7cbad6f6..06bee7a42 100644 --- a/packages/console/src/pages/ConnectorDetails/ConnectorContent/index.tsx +++ b/packages/console/src/pages/ConnectorDetails/ConnectorContent/index.tsx @@ -116,7 +116,7 @@ function ConnectorContent({ isDeleted, connectorData, onConnectorUpdated }: Prop if (connectorData.usage === undefined) { return; } - onConnectorUpdated({ ...connectorData, usage: connectorData.usage + 1 }); + onConnectorUpdated(); }, [connectorData, onConnectorUpdated]); return ( diff --git a/packages/console/src/pages/ConnectorDetails/EmailUsage/index.tsx b/packages/console/src/pages/ConnectorDetails/EmailUsage/index.tsx index 3dd173983..c6342d94a 100644 --- a/packages/console/src/pages/ConnectorDetails/EmailUsage/index.tsx +++ b/packages/console/src/pages/ConnectorDetails/EmailUsage/index.tsx @@ -16,6 +16,7 @@ import * as styles from './index.module.scss'; type Props = { usage: number; }; + function EmailUsage({ usage }: Props) { const theme = useTheme(); const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); diff --git a/packages/console/src/pages/ConnectorDetails/index.tsx b/packages/console/src/pages/ConnectorDetails/index.tsx index 33b903ae4..50278f441 100644 --- a/packages/console/src/pages/ConnectorDetails/index.tsx +++ b/packages/console/src/pages/ConnectorDetails/index.tsx @@ -51,12 +51,9 @@ function ConnectorDetails() { const [isReadMeOpen, setIsReadMeOpen] = useState(false); const [isSetupOpen, setIsSetupOpen] = useState(false); const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); - /** - * TODO: Can add `keepPreviousData` option to useSWR to avoid the flash on `Skeleton` - * component when manually trigger `mutate` function. This change is available in `swr@v2.0` or above. - */ const { data, error, mutate } = useSWR( - connectorId && `api/connectors/${connectorId}` + connectorId && `api/connectors/${connectorId}`, + { keepPreviousData: true } ); const { data: connectorFactory,