aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/DocUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-09 17:40:08 -0400
committerbobzel <zzzman@gmail.com>2025-03-09 17:40:08 -0400
commitdf173b02ffb7e2937d20a02beec1815b3af7c34e (patch)
treed5f9f383581818d302e9d42fe6f12eb2632763e9 /src/client/documents/DocUtils.ts
parent1a48ccf57ae43bc582dcd7be453e0ad217d38828 (diff)
removed simulation doc. fixed empty imageBox uploading. fixed script typechecking. fixed metadata doc. fixed setting background colors of docs that have a template.
Diffstat (limited to 'src/client/documents/DocUtils.ts')
-rw-r--r--src/client/documents/DocUtils.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts
index b216551d5..1c7ccadd1 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) {
@@ -841,7 +842,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,
@@ -851,7 +852,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;
});
}