From a19d891f386816f127ea1ee3970c6ec48adb0d74 Mon Sep 17 00:00:00 2001
From: Lionel Han <47760119+IGoByJoe@users.noreply.github.com>
Date: Thu, 18 Jun 2020 22:01:02 -0700
Subject: added mobile collection to menu and added image upload to current
 collection

---
 src/mobile/ImageUpload.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/mobile/ImageUpload.tsx')

diff --git a/src/mobile/ImageUpload.tsx b/src/mobile/ImageUpload.tsx
index b66f0461d..0b63c42be 100644
--- a/src/mobile/ImageUpload.tsx
+++ b/src/mobile/ImageUpload.tsx
@@ -29,7 +29,7 @@ export interface ImageUploadProps {
 const inputRef = React.createRef<HTMLInputElement>();
 
 @observer
-export class Uploader extends React.Component {
+export class Uploader extends React.Component<ImageUploadProps> {
     @observable error: string = "";
     @observable status: string = "";
     @observable nm: string = "Choose files";
@@ -37,6 +37,7 @@ export class Uploader extends React.Component {
 
     onClick = async () => {
         try {
+            const col = this.props.Document;
             await Docs.Prototypes.initialize();
             const imgPrev = document.getElementById("img_preview");
             const slab1 = document.getElementById("slab1");
@@ -84,7 +85,11 @@ export class Uploader extends React.Component {
                             const field = await DocServer.GetRefField(res);
                             let pending: Opt<Doc>;
                             if (field instanceof Doc) {
-                                pending = await Cast(field.rightSidebarCollection, Doc);
+                                // if (col === Cast(Doc.UserDoc().rightSidebarCollection, Doc) as Doc) {
+                                //     pending = await Cast(field.rightSidebarCollection, Doc);
+                                // }
+                                pending = col;
+                                //pending = await Cast(field.col, Doc);
                             }
                             if (pending) {
                                 const data = await Cast(pending.data, listSpec(Doc));
-- 
cgit v1.2.3-70-g09d2

