fix(front-submit): let drafts save with partial content
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4a119358ca
commit
5f31c58df2
5 files changed
+29
-9
No files matched your search
@@ -459,8 +459,10 @@ function Studio(): JSX.Element {
|
||||
return true;
|
||||
}
|
||||
const requestRevision = editRevisionRef.current;
|
||||
const hasDocument = current.title.trim() !== '' || plainText(current.content).trim() !== '';
|
||||
if (autosave && !hasDocument) {
|
||||
// 空文档(连块级内容都没有)不发请求:服务端会拒绝,前端也不该把它当失败。
|
||||
const hasDocument = current.title.trim() !== '' || plainText(current.content).trim() !== ''
|
||||
|| /<(?:img|table|pre|hr|iframe|video)/i.test(current.content);
|
||||
if (!hasDocument) {
|
||||
return true;
|
||||
}
|
||||
setSaveState({ state: 'saving', at: '' });
|
||||
|
||||
Reference in new issue
Block a user