aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-01-13 22:26:35 -0500
committerbobzel <zzzman@gmail.com>2025-01-13 22:26:35 -0500
commit12f5a435ee6476e2e07ded0c9cdd597c70ca8af0 (patch)
tree258d3f999329bf94b5725fb5a04392aa007d6150 /src/ClientUtils.ts
parentc2312afe4ee969043ba3ce4cb9c275a48b0f1ee0 (diff)
changing ai for images and collections to work mostly the same way. fixes for document view/collection/images to keep things working when the ai editor view reduces the rendered document size. fixed so that freeform views overlaid on images/vieos/etc have the ui menu items of collections.
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r--src/ClientUtils.ts23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index 8f62b9060..e5dbb81db 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -144,15 +144,20 @@ export namespace ClientUtils {
export async function convertDataUri(imageUri: string, returnedFilename: string, nosuffix = false, replaceRootFilename: string | undefined = undefined) {
try {
const posting = ClientUtils.prepend('/uploadURI');
- const returnedUri = await rp.post(posting, {
- body: {
- uri: imageUri,
- name: returnedFilename,
- nosuffix,
- replaceRootFilename,
- },
- json: true,
- });
+ const returnedUri = await rp
+ .post(posting, {
+ body: {
+ uri: imageUri,
+ name: returnedFilename,
+ nosuffix,
+ replaceRootFilename,
+ },
+ json: true,
+ })
+ .catch(e => {
+ alert('Data URI Error: ' + e.toString());
+ return undefined;
+ });
return returnedUri;
} catch (e) {
console.log('ConvertDataURI :' + e);