From d9f396e297bfb3d41e1fe15f4b143d9916001d94 Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Fri, 25 Aug 2023 12:51:16 -0400
Subject: convert url to base64, ensure img is loaded

---
 src/client/views/nodes/ImageBox.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/ImageBox.tsx')

diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 2c8e97512..f5c6a9273 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -59,8 +59,12 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
     @observable public static imageEditorOpen: boolean = false;
     @observable public static imageEditorSource: string = '';
     @observable public static addDoc: ((doc: Doc | Doc[], annotationKey?: string) => boolean) | undefined;
-    @action public static setImageEditorOpen(open: boolean) {ImageBox.imageEditorOpen = open;}
-    @action public static setImageEditorSource(source: string) {ImageBox.imageEditorSource = source;}
+    @action public static setImageEditorOpen(open: boolean) {
+        ImageBox.imageEditorOpen = open;
+    }
+    @action public static setImageEditorSource(source: string) {
+        ImageBox.imageEditorSource = source;
+    }
     private _ignoreScroll = false;
     private _forcedScroll = false;
     private _dropDisposer?: DragManager.DragDropDisposer;
@@ -307,7 +311,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
     }
 
     choosePath(url: URL) {
-        if (!url?.href) return "";
+        if (!url?.href) return '';
         const lower = url.href.toLowerCase();
         if (url.protocol === 'data') return url.href;
         if (url.href.indexOf(window.location.origin) === -1 && url.href.indexOf('dashblobstore') === -1) return Utils.CorsProxy(url.href);
-- 
cgit v1.2.3-70-g09d2

