Merge pull request #678 from toeverything/0106/surface

feat: compat with surface block structure
This commit is contained in:
DarkSky
2023-01-06 17:34:18 +08:00
committed by GitHub
9 changed files with 62 additions and 44 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ export const usePropsUpdated: UsePropsUpdated = () => {
return;
}
setTimeout(() => {
editor.model?.propsUpdated.on(() => {
editor.pageBlockModel?.propsUpdated.on(() => {
callbackQueue.current.forEach(callback => {
callback(editor);
});
@@ -26,7 +26,7 @@ export const usePropsUpdated: UsePropsUpdated = () => {
return () => {
callbackQueue.current = [];
editor?.model?.propsUpdated.dispose();
editor?.pageBlockModel?.propsUpdated?.dispose();
};
}, [editor]);