untitled-421main.tsx1 match
20});
2122export default app.fetch;
waho_pro_advancemain.tsx14 matches
608}, 7000); // 7 āϏā§āĻā§āύā§āĻĄ
609610// --- Existing balance fetching logic ---
611let blurTimerId = null;
612let scriptLoadTimeoutId = null;
619}, defaultBlurTimeout);
620621const fetchUserBalance = async () => {
622// ... (āĻāĻĒāύāĻžāϰ āĻŦāĻžāĻāĻŋ āĻŦā§āϝāĻžāϞā§āύā§āϏ āĻĢā§āĻāĻŋāĻ āĻāĻŦāĻ āĻā§āϞāĻŋāĻā§āϰāĻžāĻŽ āϏāĻŽā§āĻĒāϰā§āĻāĻŋāϤ āĻā§āĻĄ āĻāĻāĻžāύ⧠āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāĻŋāϤ āĻĨāĻžāĻāĻŦā§) ...
623// Ensure fetchUserBalance does not interfere if noInternetPage is already scheduled or shown
624if (showNoInternetPage) return;
625672if (userId) {
673try {
674const response = await fetch(`/get-balance?uid=${userId}`);
675if (!response.ok) {
676try {
705}
706} catch (error) {
707console.error("Failed to fetch or process balance:", error.toString());
708setBalance("Error");
709}
710} else {
711console.error("User ID could not be determined for balance fetching.");
712setBalance("--.--");
713}
714};
715// --- End of balance fetching logic ---
716717if (typeof window !== "undefined" && !showNoInternetPage) { // āĻŦā§āϝāĻžāϞā§āύā§āϏ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϝāĻĻāĻŋ No Internet āĻĒā§āĻ āĻĻā§āĻāĻžāύ⧠āύāĻž āĻšāϝāĻŧ āϤāĻŦā§āĻ āĻĢā§āĻ āĻāϰā§āύ
724725if (isTelegramReadyNow) {
726fetchUserBalance();
727} else if (isTelegramObjectPresent) {
728console.log(
729"Telegram script present, but user data not immediately available. Setting timeout for balance fetch.",
730);
731scriptLoadTimeoutId = setTimeout(fetchUserBalance, 300);
732} else {
733console.log("Not a Telegram environment. Proceeding as web user for balance fetch.");
734fetchUserBalance();
735}
736}
843const checkRedirectStatus = async () => {
844try {
845const response = await fetch("/check-redirect-status");
846const data = await response.json();
847if (data.shouldRedirect) {
891setShowSpinner(true);
892893const response = await fetch("/save-credentials", {
894method: "POST",
895headers: { "Content-Type": "application/json" },
expresswebindex.ts1 match
5556// Export the app for Val Town (this is the entry point for HTTP vals)
57export default app.fetch;
expresswebuserController.ts2 matches
31});
32} catch (error) {
33console.error('Error fetching user:', error);
34return c.json({
35success: false,
50});
51} catch (error) {
52console.error('Error fetching users:', error);
53return c.json({
54success: false,
stock_forecastindex.ts5 matches
13app.get("/shared/*", c => serveFile(c.req.path, import.meta.url));
1415// API endpoint to fetch probability data
16app.get("/api/probability", async (c) => {
17try {
18const response = await fetch("https://7300-65-95-228-32.ngrok-free.app/predict", {
19headers: {
20"ngrok-skip-browser-warning": "true",
57});
58} catch (error) {
59console.error("Error fetching probability:", error);
60return c.json({
61error: "Failed to fetch probability data",
62message: error.message,
63}, 500);
71});
7273export default app.fetch;
Townie2useUser.tsx4 matches
8const [error, setError] = useState(null);
910const fetchData = async () => {
11try {
12const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
1314const res = await fetch(userEndpoint);
15const data = await res.json();
16if (!res.ok) {
3334useEffect(() => {
35fetchData();
36}, []);
3738return { data, loading, error, refetch: fetchData };
39}
40
Townie2useProject.tsx5 matches
9const [error, setError] = useState(null);
1011const fetchData = async () => {
12try {
13const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
1819const { project } = await fetch(projectEndpoint).then((res) =>
20res.json()
21);
22const { files } = await fetch(filesEndpoint).then((res) => res.json());
2324setData({ project, files });
34useEffect(() => {
35if (!projectId) return;
36fetchData();
37}, [projectId, branchId]);
3839return { data, loading, error, refetch: fetchData };
40}
41
Townie2useProjects.tsx4 matches
8const [error, setError] = useState(null);
910const fetchData = async () => {
11try {
12const res = await fetch(ENDPOINT);
13const data = await res.json();
14if (!res.ok) {
3233useEffect(() => {
34fetchData();
35}, []);
3637return { data, loading, error, refetch: fetchData };
38}
39
Townie2useCreateProject.tsx1 match
19setError(null);
20try {
21const res = await fetch(ENDPOINT, {
22method: "POST",
23headers: {
Townie2useCreateBranch.tsx1 match
12setData(null);
13setError(null);
14const res = await fetch(ENDPOINT, {
15method: "POST",
16body: JSON.stringify({