From d21354fefc9f5b343e51c4db67e0bae7d0c187ee Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 24 Mar 2022 10:06:14 -0400 Subject: fixing data_url uploading to have a no suffix option. --- src/client/views/PropertiesButtons.tsx | 4 ++-- src/client/views/nodes/VideoBox.tsx | 7 +++++++ src/client/views/nodes/WebBox.tsx | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index dd6448654..24857d8ee 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -102,9 +102,9 @@ export class PropertiesButtons extends React.Component<{}, {}> { else { document.body.focus(); // so that we can access the clipboard without an error setTimeout(() => - pasteImageBitmap((data: any, error: any) => { + pasteImageBitmap((data_url: any, error: any) => { error && console.log(error); - data && VideoBox.convertDataUri(data, doc[Id] + "-thumb-frozen", true).then( + data_url && VideoBox.convertDataUri(data_url, doc[Id] + "-thumb-frozen", true).then( returnedfilename => doc["thumb-frozen"] = new ImageField(returnedfilename)); })); } diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 33fdc4935..5019d5691 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -252,6 +252,13 @@ export class VideoBox extends ViewBoxAnnotatableComponent { - VideoBox.convertDataUri(dataUrl, this.layoutDoc[Id] + "-thumb" + (new Date()).getTime(), true).then( + ((data_url: any) => { + VideoBox.convertDataUri(data_url, this.layoutDoc[Id] + "-thumb" + (new Date()).getTime(), true).then( returnedfilename => setTimeout(action(() => this.layoutDoc.thumb = new ImageField(returnedfilename)), 500)); }) .catch(function (error: any) { -- cgit v1.2.3-70-g09d2