mirror of https://github.com/fantasticit/think.git
Merge pull request #150 from fantasticit/fix/delete
This commit is contained in:
commit
4ae76f3d03
|
@ -36,15 +36,13 @@ export const useEditor = (options: Partial<EditorOptions> = {}, deps: Dependency
|
|||
|
||||
setEditor(instance);
|
||||
|
||||
if (!options.editable) {
|
||||
instance.on('transaction', () => {
|
||||
instance.on('transaction', () => {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
forceUpdate();
|
||||
});
|
||||
forceUpdate();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
instance.destroy();
|
||||
|
|
|
@ -267,13 +267,14 @@ export class CollaborationService {
|
|||
|
||||
if (docType === 'document') {
|
||||
const data = await this.documentService.findById(targetId);
|
||||
|
||||
if (data && !data.title) {
|
||||
await this.documentService.updateDocument({ id: userId } as IUser, targetId, {
|
||||
title: '未命名文档',
|
||||
});
|
||||
}
|
||||
|
||||
if (editable) {
|
||||
if (data && editable) {
|
||||
const content = data.content;
|
||||
const json = JSON.parse(content).default;
|
||||
const mentionUsers = findMentions(json);
|
||||
|
|
Loading…
Reference in New Issue