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

fix(console): the mysterious smog should disappear after creating M2M app (#3553)

This commit is contained in:
Charles Zhao 2023-03-20 22:46:48 +08:00 committed by GitHub
parent 415c2fab23
commit 80015f22fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
import type { Application } from '@logto/schemas';
import { ApplicationType } from '@logto/schemas';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate } from 'react-router-dom';
@ -128,7 +129,12 @@ function Applications() {
isOpen={isShowingCreationForm}
onClose={async (newApp) => {
if (newApp) {
navigate(buildGuidePathname(newApp.id), { replace: true });
const buildNavigatePath =
newApp.type === ApplicationType.MachineToMachine
? buildDetailsPathname
: buildGuidePathname;
navigate(buildNavigatePath(newApp.id), { replace: true });
return;
}