* enforceAppendOnly for options, votes and deadlines

This commit is contained in:
2026-05-04 23:02:54 +02:00
parent 2abc0f8930
commit 043e813864
3 changed files with 38 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import * as Y from "yjs";
import type { OptionRecord } from "../state";
import { PollOption } from "./PollOption";
import { enforceAppendOnly } from "../yDocUtil";
export function PollList(
yOptions: Y.Map<OptionRecord>,
@@ -119,8 +120,8 @@ export function PollList(
});
}
yOptions.observeDeep(() => render());
yVotes.observe(() => render());
yOptions.observe(enforceAppendOnly(yOptions,render));
yVotes.observe(enforceAppendOnly(yVotes,render));
render();
return wrapper;