@ai-matrx/meet 0.7.12 → 0.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +12 -6
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +12 -6
- package/dist/react.js.map +1 -1
- package/package.json +3 -3
package/dist/react.js
CHANGED
|
@@ -1695,7 +1695,18 @@ function withItem(collab, row, fromRoom = false) {
|
|
|
1695
1695
|
const poll = pollFromRow(row);
|
|
1696
1696
|
if (poll === null) return collab;
|
|
1697
1697
|
const known = collab.polls.find((p) => p.id === poll.id);
|
|
1698
|
-
|
|
1698
|
+
let merged = fromRoom && known !== void 0 ? { ...poll, myVote: known.myVote } : poll;
|
|
1699
|
+
if (fromRoom && known !== void 0 && !poll.options.some((o) => o.votes !== void 0)) {
|
|
1700
|
+
const counted = new Map(known.options.map((o) => [o.id, o]));
|
|
1701
|
+
merged = {
|
|
1702
|
+
...merged,
|
|
1703
|
+
voterCount: known.voterCount,
|
|
1704
|
+
options: merged.options.map((o) => {
|
|
1705
|
+
const had = counted.get(o.id);
|
|
1706
|
+
return had === void 0 ? o : { ...o, votes: had.votes, voters: had.voters };
|
|
1707
|
+
})
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1699
1710
|
return { ...collab, polls: upsert(collab.polls, merged) };
|
|
1700
1711
|
}
|
|
1701
1712
|
if (kind === "question") {
|
|
@@ -1728,13 +1739,8 @@ function without(collab, ids) {
|
|
|
1728
1739
|
}
|
|
1729
1740
|
function applyCollabPacket(collab, payload, context) {
|
|
1730
1741
|
const item = obj(payload["item"]);
|
|
1731
|
-
const audience = str(payload["audience"]);
|
|
1732
1742
|
if (item !== null) {
|
|
1733
1743
|
const kind = str(item["kind"]);
|
|
1734
|
-
const hostOnlyView = kind === "poll" || kind === "question";
|
|
1735
|
-
if (hostOnlyView && context.isHost && audience !== "hosts") {
|
|
1736
|
-
return { next: null, dropped: "the room copy of an item a host receives in full" };
|
|
1737
|
-
}
|
|
1738
1744
|
let next = withItem(collab, item, true);
|
|
1739
1745
|
if (kind === "poll" && str(item["state"]) === "live") {
|
|
1740
1746
|
const before = collab.polls.find((p) => p.id === str(item["id"]));
|