Editor moves

This commit is contained in:
2026-02-07 23:39:15 +01:00
parent 1ae88f2e22
commit 5123ebc6b7
2 changed files with 6 additions and 35 deletions
+4 -1
View File
@@ -43,7 +43,10 @@ function getLanguageExtension(lang: Language) {
export default function Editor({ run }: { run: LiveRun | null | undefined }) {
const [editorView, setEditorView] = useState<EditorView>();
const [moves] = useActionOnce<LiveRunMove[]>(getLiveRunMoves, [run]);
const [moves] = useActionOnce<LiveRunMove[]>(
async () => (run ? (await getLiveRunMoves(run.id)) || [] : []),
[run],
);
useEffect(() => {
if (!editorView || !moves) return;