fix: guard oauthProviders with Array.isArray to prevent TypeError on Login page

Fixes 'Cannot read properties of undefined (reading length)' crash
in Telegram WebView when API returns unexpected response shape.
This commit is contained in:
Fringg
2026-02-11 02:42:32 +03:00
parent 6bf0af4ff3
commit f74e316161

View File

@@ -100,7 +100,7 @@ export default function Login() {
queryFn: authApi.getOAuthProviders,
staleTime: 60000,
});
const oauthProviders = oauthData?.providers ?? [];
const oauthProviders = Array.isArray(oauthData?.providers) ? oauthData.providers : [];
const [oauthLoading, setOauthLoading] = useState<string | null>(null);