client: fix uploading files when no files are present
This commit is contained in:
parent
c1dcfb6a58
commit
266848e6b2
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ const Post = () => {
|
|||
|
||||
const uploadDocs = useCallback((files: DocumentType[]) => {
|
||||
// if no title is set and the only document is empty,
|
||||
const isFirstDocEmpty = docs.length <= 1 && docs[0].title === '' && docs[0].content === ''
|
||||
const isFirstDocEmpty = docs.length <= 1 && (docs.length ? docs[0].title === '' : true)
|
||||
const shouldSetTitle = !title && isFirstDocEmpty
|
||||
if (shouldSetTitle) {
|
||||
if (files.length === 1) {
|
||||
|
|
Loading…
Reference in a new issue