mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 03:42:08 +03:00
feat: compatiable with async importMarkdown()
This commit is contained in:
parent
cc13bf8265
commit
b1a39fa2e7
@ -26,7 +26,7 @@ export const usePropsUpdated: UsePropsUpdated = () => {
|
||||
|
||||
return () => {
|
||||
callbackQueue.current = [];
|
||||
editor?.model?.propsUpdated.dispose();
|
||||
editor?.model?.propsUpdated?.dispose();
|
||||
};
|
||||
}, [editor]);
|
||||
|
||||
|
@ -43,13 +43,16 @@ const All = () => {
|
||||
if (page) {
|
||||
currentWorkspace?.setPageMeta(page.id, { title });
|
||||
if (page && page.root === null) {
|
||||
setTimeout(() => {
|
||||
setTimeout(async () => {
|
||||
const editor = document.querySelector('editor-container');
|
||||
if (editor) {
|
||||
page.addBlock({ flavour: 'affine:surface' }, null);
|
||||
const frameId = page.addBlock({ flavour: 'affine:frame' }, pageId);
|
||||
// TODO blocksuite should offer a method to import markdown from store
|
||||
editor.clipboard.importMarkdown(template.source, `${frameId}`);
|
||||
await editor.clipboard.importMarkdown(
|
||||
template.source,
|
||||
`${frameId}`
|
||||
);
|
||||
page.resetHistory();
|
||||
editor.requestUpdate();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user