From db343a6a94131020ff812466a586d6e673d5d61a Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:55:01 +0800 Subject: [PATCH] tweaks --- web/app/(shareLayout)/components/splash.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/app/(shareLayout)/components/splash.tsx b/web/app/(shareLayout)/components/splash.tsx index 267fae4338..a40db60782 100644 --- a/web/app/(shareLayout)/components/splash.tsx +++ b/web/app/(shareLayout)/components/splash.tsx @@ -26,14 +26,14 @@ const Splash: FC = ({ children }) => { }, [searchParams]) const backToHome = useCallback(async () => { - if (shareCode) - await webAppLogout(shareCode) + await webAppLogout(shareCode!) const url = getSigninUrl() router.replace(url) }, [getSigninUrl, router, shareCode]) useEffect(() => { - if (message || !shareCode) + if (message) { return + } if (tokenFromUrl) setWebAppAccessToken(tokenFromUrl) @@ -45,7 +45,7 @@ const Splash: FC = ({ children }) => { (async () => { // if access mode is public, user login is always true, but the app login(passport) may be expired - const { userLoggedIn, appLoggedIn } = await webAppLoginStatus(shareCode, embeddedUserId || undefined) + const { userLoggedIn, appLoggedIn } = await webAppLoginStatus(shareCode!, embeddedUserId || undefined) if (userLoggedIn && appLoggedIn) { redirectOrFinish() } @@ -55,14 +55,14 @@ const Splash: FC = ({ children }) => { else if (userLoggedIn && !appLoggedIn) { try { const { access_token } = await fetchAccessToken({ - appCode: shareCode, + appCode: shareCode!, userId: embeddedUserId || undefined, }) - setWebAppPassport(shareCode, access_token) + setWebAppPassport(shareCode!, access_token) redirectOrFinish() } catch { - await webAppLogout(shareCode) + await webAppLogout(shareCode!) } } })() @@ -79,7 +79,7 @@ const Splash: FC = ({ children }) => { return (
- {code === '403' ? t('userProfile.logout', { ns: 'common' }) : t('login.backToHome', { ns: 'share' })} + {code === '403' ? t('userProfile.logout', { ns: 'common' }) : t('login.backToHome', { ns: 'share' })}
) }