From 140e2f643f97057ba9c89c502cff7843bd738cd6 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 9 Jun 2022 16:59:09 -0400
Subject: fixed issues with taking dashboard snapshots to update dashboard view

---
 .../collections/collectionFreeForm/CollectionFreeFormView.tsx  | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index f4d2d55d5..ef3a896e1 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1532,7 +1532,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         const htmlString = new XMLSerializer().serializeToString(newDiv);
         const nativeWidth = width;
         const nativeHeight = height;
-        CreateImage(
+        return CreateImage(
             Utils.prepend(""),
             document.styleSheets,
             htmlString,
@@ -1540,11 +1540,9 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
             nativeWidth * panelHeight / panelWidth,
             scrollTop
         ).then
-            ((data_url: any) => {
-                VideoBox.convertDataUri(data_url, filename).then(
-                    returnedfilename => setTimeout(() => {
-                        cb(returnedfilename as string, nativeWidth, nativeHeight);
-                    }, 500));
+            (async (data_url: any) => {
+                const returnedFilename = await VideoBox.convertDataUri(data_url, filename);
+                cb(returnedFilename as string, nativeWidth, nativeHeight);
             })
             .catch(function (error: any) {
                 console.error('oops, something went wrong!', error);
-- 
cgit v1.2.3-70-g09d2

