reactions SSE!
This commit is contained in:
@@ -29,8 +29,6 @@ const MatchCard = ({ match }: MatchCardProps) => {
|
||||
}
|
||||
};
|
||||
|
||||
console.log(match);
|
||||
|
||||
return (
|
||||
<Indicator
|
||||
disabled={!isStarted}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { useServerSuspenseQuery, useServerQuery } from "@/lib/tanstack-query/hooks";
|
||||
import { getMatchReactions } from "./server";
|
||||
|
||||
export const matchKeys = {
|
||||
list: ['matches', 'list'] as const,
|
||||
details: (id: string) => ['matches', 'details', id] as const,
|
||||
reactions: (id: string) => ['matches', 'reactions', id] as const,
|
||||
};
|
||||
|
||||
export const matchQueries = {
|
||||
reactions: (matchId: string) => ({
|
||||
queryKey: matchKeys.reactions(matchId),
|
||||
queryFn: () => getMatchReactions({ data: matchId }),
|
||||
}),
|
||||
};
|
||||
|
||||
export const useMatchReactions = (matchId: string) =>
|
||||
useServerQuery(matchQueries.reactions(matchId));
|
||||
@@ -153,7 +153,6 @@ export const startMatch = createServerFn()
|
||||
status: "started",
|
||||
});
|
||||
|
||||
console.log('emitting start match...')
|
||||
serverEvents.emit("match", {
|
||||
type: "match",
|
||||
matchId: match.id,
|
||||
@@ -300,7 +299,6 @@ export const toggleMatchReaction = createServerFn()
|
||||
serverEvents.emit("reaction", {
|
||||
type: "reaction",
|
||||
matchId,
|
||||
tournamentId: match.tournament.id,
|
||||
reactions,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user