diff --git a/packages/console/src/pages/GetStarted/components/GetStartedProgress/index.tsx b/packages/console/src/pages/GetStarted/components/GetStartedProgress/index.tsx index 1b364816f..925620ec7 100644 --- a/packages/console/src/pages/GetStarted/components/GetStartedProgress/index.tsx +++ b/packages/console/src/pages/GetStarted/components/GetStartedProgress/index.tsx @@ -17,7 +17,7 @@ const GetStartedProgress = () => { } = useUserPreferences(); const anchorRef = useRef(null); const [showDropDown, setShowDropdown] = useState(false); - const { data, completedCount, totalCount } = useGetStartedMetadata(); + const { data, completedCount, totalCount } = useGetStartedMetadata({ checkDemoAppExists: false }); if (hideGetStarted) { return null; diff --git a/packages/console/src/pages/GetStarted/hook.ts b/packages/console/src/pages/GetStarted/hook.ts index 9067cf85d..4099a582d 100644 --- a/packages/console/src/pages/GetStarted/hook.ts +++ b/packages/console/src/pages/GetStarted/hook.ts @@ -23,17 +23,24 @@ type GetStartedMetadata = { onClick: () => void; }; -const useGetStartedMetadata = () => { - const { settings, updateSettings } = useSettings(); - const { data: demoApp, error } = useSWR('/api/applications/demo_app', { - shouldRetryOnError: (error: unknown) => { - if (error instanceof RequestError) { - return error.status !== 404; - } +type Props = { + checkDemoAppExists: boolean; +}; - return true; - }, - }); +const useGetStartedMetadata = ({ checkDemoAppExists }: Props) => { + const { settings, updateSettings } = useSettings(); + const { data: demoApp, error } = useSWR( + checkDemoAppExists && '/api/applications/demo_app', + { + shouldRetryOnError: (error: unknown) => { + if (error instanceof RequestError) { + return error.status !== 404; + } + + return true; + }, + } + ); const navigate = useNavigate(); const isLoadingDemoApp = !demoApp && !error; const hideDemo = error?.status === 404; diff --git a/packages/console/src/pages/GetStarted/index.tsx b/packages/console/src/pages/GetStarted/index.tsx index ebd612f04..76b43c420 100644 --- a/packages/console/src/pages/GetStarted/index.tsx +++ b/packages/console/src/pages/GetStarted/index.tsx @@ -16,7 +16,7 @@ import * as styles from './index.module.scss'; const GetStarted = () => { const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const navigate = useNavigate(); - const { data, isLoading } = useGetStartedMetadata(); + const { data, isLoading } = useGetStartedMetadata({ checkDemoAppExists: true }); const { update } = useUserPreferences(); const [showConfirmModal, setShowConfirmModal] = useState(false);