fix: improved error reporting in super; improved draggable block icon padding

This commit is contained in:
Mo
2022-11-18 20:54:03 -06:00
parent e8b758214d
commit 24ff87c306
4 changed files with 13 additions and 8 deletions

View File

@@ -67,8 +67,14 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
});
previewText = truncateString(previewText, previewLength);
const stringifiedEditorState = JSON.stringify(editorState.toJSON());
onChange(stringifiedEditorState, previewText);
try {
const stringifiedEditorState = JSON.stringify(editorState.toJSON());
onChange(stringifiedEditorState, previewText);
} catch (error) {
window.alert(
`An invalid change was made inside the Super editor. Your change was not saved. Please report this error to the team: ${error}`,
);
}
});
},
[onChange, didIgnoreFirstChange],