mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user