From 93ab66d7c5f24c2b33c39ccbdc7c936632fffba7 Mon Sep 17 00:00:00 2001 From: Minsu Kim Date: Sun, 15 Dec 2024 00:59:23 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B3=B5=EC=97=B0=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20=EC=9D=B4=ED=9B=84=20=EC=9D=B4=EB=8F=99=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/pages/ShowAddPage/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/admin/src/pages/ShowAddPage/index.tsx b/apps/admin/src/pages/ShowAddPage/index.tsx index e8a1200c..1781e530 100644 --- a/apps/admin/src/pages/ShowAddPage/index.tsx +++ b/apps/admin/src/pages/ShowAddPage/index.tsx @@ -29,7 +29,7 @@ import Styled from './ShowAddPage.styles'; import ShowCastInfoFormContent from '~/components/ShowInfoFormContent/ShowCastInfoFormContent'; import ShowCastInfo from '~/components/ShowCastInfo'; import { TempShowCastInfoFormInput } from '~/components/ShowCastInfoFormDialogContent'; -import { checkIsWebView } from '@boolti/bridge'; +import { checkIsWebView, isWebViewBridgeAvailable, navigateToShowDetail } from '@boolti/bridge'; import useCastTeamListOrder from '~/hooks/useCastTeamListOrder'; interface ShowAddPageProps { @@ -38,7 +38,7 @@ interface ShowAddPageProps { const ShowAddPage = ({ step }: ShowAddPageProps) => { const navigate = useNavigate(); - const isWebView = checkIsWebView(window.navigator.userAgent); + const isWebView = checkIsWebView(); const [imageFiles, setImageFiles] = useState([]); const [salesTicketList, setSalesTicketList] = useState([]); @@ -66,7 +66,7 @@ const ShowAddPage = ({ step }: ShowAddPageProps) => { const showImageInfo = await uploadShowImageMutation.mutateAsync(imageFiles); // 공연 생성 - await addShowMutation.mutateAsync({ + const showId = await addShowMutation.mutateAsync({ name: showInfoForm.getValues('name'), images: showImageInfo, date: `${showInfoForm.getValues('date')}T${showInfoForm.getValues('startTime')}:00.000Z`, @@ -104,6 +104,11 @@ const ShowAddPage = ({ step }: ShowAddPageProps) => { })) as ShowCastTeamCreateOrUpdateRequest[], }); + if (isWebView && isWebViewBridgeAvailable()) { + navigateToShowDetail({ showId }); + return; + } + navigate(PATH.SHOW_ADD_COMPLETE); };