aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-09-06 14:06:02 -0400
committerbobzel <zzzman@gmail.com>2022-09-06 14:06:02 -0400
commite70360946815cdcde434e25eb592e1b919bb4105 (patch)
tree9a4ab96011f8b1bc0fd48c599904e1d457b43cf6 /src/client/documents/Documents.ts
parent35d5458347a10b9af9bcf65e5fddbb92d842c8b1 (diff)
final cleanup of dragging rotated images. fixed loading of youtube videos and displaying errors when the upload fails
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 8c3b91177..7111cb233 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1,5 +1,4 @@
import { IconProp } from '@fortawesome/fontawesome-svg-core';
-import { files } from 'jszip';
import { action, runInAction } from 'mobx';
import { basename } from 'path';
import { DateField } from '../../fields/DateField';
@@ -1780,6 +1779,9 @@ export namespace DocUtils {
proto.lng = ConvertDMSToDD(longitude[0], longitude[1], longitude[2], longitudeDirection);
}
}
+ if (Upload.isVideoInformation(result)) {
+ proto['data-duration'] = result.duration;
+ }
generatedDocuments.push(doc);
}
}
@@ -1814,7 +1816,7 @@ export namespace DocUtils {
source: { name, type },
result,
} of await Networking.UploadYoutubeToServer(videoId)) {
- name && type && processFileupload(generatedDocuments, name, type, result, options);
+ name && processFileupload(generatedDocuments, name, type, result, options);
}
return generatedDocuments;
}
@@ -1826,7 +1828,12 @@ export namespace DocUtils {
source: { name, type },
result,
} = upfiles.lastElement();
- name && type && processFileupload(generatedDocuments, name, type, result, options, overwriteDoc);
+ if ((result as any).message) {
+ if (overwriteDoc) {
+ overwriteDoc.isLoading = false;
+ overwriteDoc.errorMessage = (result as any).message;
+ }
+ } else name && processFileupload(generatedDocuments, name, type, result, options, overwriteDoc);
});
}