diff --git a/apps/web/hooks/telegram/use-back-button.ts b/apps/web/hooks/telegram/use-back-button.ts index 58238db..3e9632d 100644 --- a/apps/web/hooks/telegram/use-back-button.ts +++ b/apps/web/hooks/telegram/use-back-button.ts @@ -4,6 +4,8 @@ import { backButton } from '@telegram-apps/sdk-react'; import { usePathname, useRouter } from 'next/navigation'; import { useCallback, useEffect } from 'react'; +const exclude = ['/pro']; + export function useBackButton() { const { back } = useRouter(); const pathname = usePathname(); @@ -31,6 +33,8 @@ export function useBackButton() { }, [pathname]); } -function isRootLevelPage(path: string) { - return path.split('/').filter(Boolean).length === 1; +function isRootLevelPage(pathname: string) { + if (exclude.includes(pathname)) return true; + + return pathname.split('/').filter(Boolean).length === 1; }