diff options
author | bobzel <zzzman@gmail.com> | 2025-03-10 12:49:40 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-03-10 12:49:40 -0400 |
commit | 289030cc82c4cef6db46695c841cb99e4cd90101 (patch) | |
tree | f60ec8c6af0d437ca60931d5e5ee40483bae251b /src/client/documents/DocUtils.ts | |
parent | 97f2fd0fe18bf476304af06918de25059d4fd8b5 (diff) | |
parent | df173b02ffb7e2937d20a02beec1815b3af7c34e (diff) |
Merge branch 'master' into aarav_edit
Diffstat (limited to 'src/client/documents/DocUtils.ts')
-rw-r--r-- | src/client/documents/DocUtils.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts index 914e94bfa..84e2db989 100644 --- a/src/client/documents/DocUtils.ts +++ b/src/client/documents/DocUtils.ts @@ -691,6 +691,7 @@ export namespace DocUtils { } generatedDocuments.push(doc); } + return doc; } export function GetNewTextDoc(title: string, x: number, y: number, width?: number, height?: number, annotationOn?: Doc, backgroundColor?: string) { @@ -868,7 +869,7 @@ export namespace DocUtils { export function uploadFileToDoc(file: File, options: DocumentOptions, overwriteDoc: Doc) { const generatedDocuments: Doc[] = []; // Since this file has an overwriteDoc, we can set the client tracking guid to the overwriteDoc's guid. - Networking.UploadFilesToServer([{ file, guid: overwriteDoc[Id] }]).then(upfiles => { + return Networking.UploadFilesToServer([{ file, guid: overwriteDoc[Id] }]).then(upfiles => { const { source: { newFilename, mimetype }, result, @@ -878,7 +879,9 @@ export namespace DocUtils { overwriteDoc.loadingError = result.message; Doc.removeCurrentlyLoading(overwriteDoc); } - } else newFilename && mimetype && processFileupload(generatedDocuments, newFilename, mimetype, result, options, overwriteDoc); + return undefined; + } + return newFilename && mimetype ? processFileupload(generatedDocuments, newFilename, mimetype, result, options, overwriteDoc) : undefined; }); } |