feat(apps/web): update user photo on app launch
This commit is contained in:
parent
f1f1ac3183
commit
56a299c656
@ -1,4 +1,5 @@
|
||||
'use client';
|
||||
import { updateProfile } from '@/actions/profile';
|
||||
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
|
||||
import { initData, isMiniAppDark, useSignal } from '@telegram-apps/sdk-react';
|
||||
import { signIn, useSession } from 'next-auth/react';
|
||||
@ -15,6 +16,8 @@ export default function Auth() {
|
||||
useEffect(() => {
|
||||
setTheme(isDark ? 'dark' : 'light');
|
||||
|
||||
if (initDataUser?.photoUrl) updateProfile({ photoUrl: initDataUser?.photoUrl });
|
||||
|
||||
if (status === 'authenticated') {
|
||||
redirect('/profile');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user