Bugfix/delete log (#315)

* fix delete log

* fix delete log
This commit is contained in:
DiamondThree
2022-08-24 13:47:47 +08:00
committed by GitHub
parent 15055bc7c6
commit 617e9a0612
5 changed files with 13 additions and 9 deletions
+3 -2
View File
@@ -52,6 +52,7 @@ const AffineBoard = ({
});
const { shapes, bindings } = useShapes(workspace, rootBlockId);
useEffect(() => {
if (app) {
app.replacePageContent(shapes || {}, bindings, {});
@@ -109,7 +110,6 @@ const AffineBoard = ({
});
}
shape.affineId = block.id;
Object.keys(bindings).forEach(bilingKey => {
if (
bindings[bilingKey]?.fromId === shape.id
@@ -148,7 +148,8 @@ const AffineBoard = ({
Object.assign(pageBindings, bindings);
}
});
services.api.editorBlock.update({
await services.api.editorBlock.update({
workspace: workspace,
id: rootBlockId,
properties: {
@@ -12,7 +12,7 @@ const getBindings = (workspace: string, rootBlockId: string) => {
ids: [rootBlockId],
})
.then(blcoks => {
return blcoks[0].properties.bindings?.value;
return blcoks[0]?.properties.bindings?.value;
});
};
@@ -104,6 +104,7 @@ export const useShapes = (workspace: string, rootBlockId: string) => {
return acc;
}, {} as Record<string, TDShape>);
return {
shapes: blocksShapes,
bindings: JSON.parse(blocks?.bindings ?? '{}'),