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