Skip to content

Commit

Permalink
fix: edgeless text error when importing from snapshot (toeverything#3229
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Saul-Mirone committed Jun 27, 2023
1 parent a8e8ba4 commit 836e6fd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/store/src/workspace/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ export class Workspace {
const sanitize = async (props: Record<string, never>) => {
const result: Record<string, unknown> = {};

//TODO: https://github.com/toeverything/blocksuite/issues/2939
if (props['sys:flavour'] === 'affine:surface' && props['prop:elements']) {
Object.values(props['prop:elements']).forEach(element => {
const _element = element as Record<string, unknown>;
if (_element['type'] === 'text') {
const yText = new Y.Text();
yText.applyDelta(_element['text']);
_element['text'] = yText;
}
});
}

// setup embed source
if (props['sys:flavour'] === 'affine:image') {
try {
Expand Down

0 comments on commit 836e6fd

Please sign in to comment.