From 8a0725938c61e34dab98ec3fffc2bec8c1c1774d Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Mon, 31 Jul 2023 16:27:52 +0800 Subject: [PATCH] fix(console): display guidance on application created (#4268) --- packages/console/src/pages/ApplicationDetails/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/console/src/pages/ApplicationDetails/index.tsx b/packages/console/src/pages/ApplicationDetails/index.tsx index e739e2ec6..ef6adea98 100644 --- a/packages/console/src/pages/ApplicationDetails/index.tsx +++ b/packages/console/src/pages/ApplicationDetails/index.tsx @@ -10,7 +10,7 @@ import { useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { toast } from 'react-hot-toast'; import { Trans, useTranslation } from 'react-i18next'; -import { useLocation, useParams } from 'react-router-dom'; +import { useParams } from 'react-router-dom'; import useSWR from 'swr'; import Delete from '@/assets/icons/delete.svg'; @@ -51,8 +51,9 @@ const mapToUriOriginFormatArrays = (value?: string[]) => function ApplicationDetails() { const { id } = useParams(); - const { pathname } = useLocation(); - const isGuideView = !!id && pathname === `/applications/${id}/guide`; + const { navigate, match } = useTenantPathname(); + const isGuideView = id && match(`/applications/${id}/guide`); + const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const { data, error, mutate } = useSWR( id && `api/applications/${id}` @@ -69,7 +70,6 @@ function ApplicationDetails() { const [isDeleting, setIsDeleting] = useState(false); const [isDeleted, setIsDeleted] = useState(false); const api = useApi(); - const { navigate } = useTenantPathname(); const formMethods = useForm({ defaultValues: { customClientMetadata: customClientMetadataDefault }, });