0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): display guidance on application created (#4268)

This commit is contained in:
Xiao Yijun 2023-07-31 16:27:52 +08:00 committed by GitHub
parent 3e3e446b92
commit 8a0725938c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<ApplicationResponse, RequestError>(
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<Application & { isAdmin: boolean }>({
defaultValues: { customClientMetadata: customClientMetadataDefault },
});