Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hxhxhx88 committed Mar 4, 2024
1 parent 8412d50 commit c477696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/frontend/src/state/annotate/annotation-broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ export function useSeparateComponent(): Pick<StateManipulation, 'separateCompone
break;
}
case 'polychain': {
const vs = verts.get(cid);
const vs = verts.get(cid)?.clone();
if (!vs) {
console.warn(`polychain vertices for ${cid} not found`);
return;
}
doc.transact(() => {
comps.delete(cid);
verts.delete(cid);
verts.set(newComponentId, vs.clone());
verts.set(newComponentId, vs);
comps.set(newComponentId, {...comp, eid: newEntityId});
});
break;
Expand Down
7 changes: 6 additions & 1 deletion app/yjs-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ setPersistence({
});
});

db.get<{ anno: string | null }>(
db.get<{ anno: string | null } | undefined>(
"SELECT annotation_json AS anno FROM videos WHERE id = ?",
[videoId],
(err, row) => {
Expand All @@ -66,6 +66,11 @@ setPersistence({
resolve();
return;
}
if (!row) {
resolve();
return;
}

const annoJsonStr = row.anno;
if (annoJsonStr === null) {
// no annotation
Expand Down

0 comments on commit c477696

Please sign in to comment.