Live run moves

This commit is contained in:
2026-02-08 16:04:51 +01:00
parent 0d9ea07b4e
commit 8f7fc0188c
5 changed files with 18 additions and 7 deletions
+6 -2
View File
@@ -43,11 +43,15 @@ function getLanguageExtension(lang: Language) {
export default function Editor({ run }: { run: LiveRun | null | undefined }) {
const [editorView, setEditorView] = useState<EditorView>();
const [moves] = useActionOnce<LiveRunMove[]>(
async () => (run ? (await getLiveRunMoves(run.id)) || [] : []),
const [moves] = useAction<LiveRunMove[]>(
async () => (run ? await getLiveRunMoves(run.id) : []),
[run],
);
useEffect(() => {
console.log(moves);
}, [moves]);
useEffect(() => {
if (!editorView || !moves) return;