fix:shapaes

This commit is contained in:
DiamondThree
2022-08-19 16:37:04 +08:00
parent 22883de54e
commit 2eaf26c40f
2 changed files with 23 additions and 32 deletions
+1 -4
View File
@@ -45,8 +45,6 @@ const AffineBoard = ({ workspace, rootBlockId }: AffineBoardProps) => {
});
const { shapes, bindings } = useShapes(workspace, rootBlockId);
// const bindings = useBindings(workspace, rootBlockId);
useEffect(() => {
if (app) {
app.replacePageContent(shapes || {}, bindings, {});
@@ -124,7 +122,7 @@ const AffineBoard = ({ workspace, rootBlockId }: AffineBoardProps) => {
workspace: workspace,
ids: [rootBlockId],
})
)?.[0].properties.bindings.value;
)?.[0].properties.bindings?.value;
let pageBindings = JSON.parse(pageBindingsString ?? '{}');
Object.keys(bindings).forEach(bindingsKey => {
if (bindings[bindingsKey] === undefined) {
@@ -133,7 +131,6 @@ const AffineBoard = ({ workspace, rootBlockId }: AffineBoardProps) => {
Object.assign(pageBindings, bindings);
}
});
console.log(pageBindings);
services.api.editorBlock.update({
workspace: workspace,
id: rootBlockId,