From 5c4e1327bebaad934b16cbfa60888ffceb089d28 Mon Sep 17 00:00:00 2001 From: Samandar Turgunboyev Date: Sat, 29 Nov 2025 10:34:56 +0500 Subject: [PATCH] websocket bug fiz --- src/features/auth/ui/login.tsx | 7 ++++++- src/token-layaout.tsx | 2 +- vite.config.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/auth/ui/login.tsx b/src/features/auth/ui/login.tsx index 502f3ec..74c44d7 100644 --- a/src/features/auth/ui/login.tsx +++ b/src/features/auth/ui/login.tsx @@ -37,7 +37,11 @@ import z from "zod"; import { auth_api } from "../lib/api"; import { loginform } from "../lib/form"; -export default function LoginForm() { +interface LoginFormProps { + onLogin: (body: { telegram_id: string }) => void; +} + +export default function LoginForm({ onLogin }: LoginFormProps) { const { user, setLoginUser } = userInfoStore(); const form = useForm>({ @@ -66,6 +70,7 @@ export default function LoginForm() { first_name: form.getValues("firstName"), last_name: form.getValues("lastName"), }); + onLogin({ telegram_id: user.user_id }); }, onError: (error: AxiosError) => { const data = error.response?.data as { message?: string }; diff --git a/src/token-layaout.tsx b/src/token-layaout.tsx index e6c00a5..185dc71 100644 --- a/src/token-layaout.tsx +++ b/src/token-layaout.tsx @@ -110,7 +110,7 @@ const TokenLayout = ({ children }: { children: React.ReactNode }) => { ); } - return <>{token || gettoken ? children : }; + return <>{token || gettoken ? children : }; }; export default TokenLayout; diff --git a/vite.config.ts b/vite.config.ts index fa57bdf..bab380c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,7 +17,7 @@ export default defineConfig({ port: 5174, host: true, // barcha hostlarga ruxsat allowedHosts: [ - "seating-hostel-amended-ooo.trycloudflare.com", // ngrok host qo'shildi + "factory-epa-announced-adapter.trycloudflare.com", // ngrok host qo'shildi ], }, });