We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eacb5ab commit 0cff434Copy full SHA for 0cff434
src/client/run.ts
@@ -25,8 +25,9 @@ export const useFlip = () => useAtom(flipAtom);
25
26
export function useSolutionContents() {
27
const [file] = useSolutionFile();
28
+ const [flip] = useFlip();
29
return useQuery({
- queryKey: ["solution", id(file)],
30
+ queryKey: ["solution", id(file), flip],
31
queryFn: async () => {
32
if (!file) return;
33
const text = await file.text();
@@ -39,7 +40,7 @@ export function useSolutionContents() {
39
40
const pairs = p.split("->");
41
return pairs.filter(identity).map((p) => {
42
const [x, y] = trim(p, "()").split(",");
- return { x: +x, y: +y };
43
+ return flip ? { x: +x, y: +y } : { x: +y, y: +x };
44
});
45
}),
46
};
0 commit comments