A Prediction Market on the AT Protocol

Revert "feat(web): more mpv ui, realtime refetching"

This reverts commit 557480150f744fa326f86c73041e72004f0b31a5.

Ciaran efc3ce94 55748015

+6 -5
+1 -3
src/web/app.tsx
··· 11 11 import { useAuth } from "./providers/useAuth"; 12 12 import type { ResourceUri } from "@atcute/lexicons"; 13 13 import { toast } from "sonner"; 14 - import { queryClient } from "./main"; 15 14 16 15 function parseMarket(market: Market) { 17 16 let [yes, no] = [0, 0]; ··· 54 53 cid: market.cid, 55 54 }, position, profile.did, client) 56 55 if (res.uri) { 57 - toast(<>Placed {position.toUpperCase()} Bet <a target="_blank" href={`https://pdsls.dev/${res.uri}`}>{res.uri.split("/")[res.uri.split("/").length - 1]}</a> at market: <a target="_blank" href={`https://pdsls.dev/${market.uri}`}>{market.rkey}</a></>) 56 + toast(<>Placed {position.toUpperCase()} Bet <a target="_blank" href={`https://pdsls.dev/${res.uri}`}>{res.uri.split("/")[res.uri.split("/").length-1]}</a> at market: <a target="_blank" href={`https://pdsls.dev/${market.uri}`}>{market.rkey}</a></>) 58 57 } 59 - queryClient.invalidateQueries({ queryKey: ['markets'] }); 60 58 } catch (e) { 61 59 toast(e as any) 62 60 }
+1 -1
src/web/main.tsx
··· 7 7 import Cumulus from './providers/cumulus-provider.tsx'; 8 8 import { Toaster } from './components/ui/sonner.tsx'; 9 9 10 - export const queryClient = new QueryClient(); 10 + const queryClient = new QueryClient(); 11 11 12 12 createRoot(document.getElementById('root')!).render( 13 13 <StrictMode>
+4 -1
src/web/providers/cumulus-provider.tsx
··· 1 1 import { treaty } from "@elysiajs/eden" 2 2 import { createContext, type PropsWithChildren } from "react"; 3 + import { useAuth } from "./useAuth"; 3 4 import { useQuery, type UseQueryResult } from "@tanstack/react-query"; 4 5 import { type CumulusServer } from "@/server/types"; 5 6 import type { InferSelectModel } from "drizzle-orm"; ··· 21 22 22 23 const server = treaty<CumulusServer>(window.location.origin); 23 24 25 + const { profile } = useAuth(); 26 + 24 27 const markets = useQuery({ 25 - queryKey: ['markets'], 28 + queryKey: ['user', profile.did, 'markets'], 26 29 queryFn: async () => { 27 30 const { data, error } = await server.api.markets.get() 28 31 if (error) throw error;