aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/ImageUpload.tsx
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-07-23 11:38:10 -0400
committerab <abdullah_ahmed@brown.edu>2019-07-23 11:38:10 -0400
commit13c016d7f7765acda7f6ce2d69c14597469f55d7 (patch)
tree6fcf409ee4f0035443aa4fb67a05d24aae09689d /src/mobile/ImageUpload.tsx
parentbd841fe56540e1a9177d2872310b10fefcb4acd1 (diff)
parentd880e4b2fcb4e7bab3ee25d63209b173efcf37c0 (diff)
merged
Diffstat (limited to 'src/mobile/ImageUpload.tsx')
-rw-r--r--src/mobile/ImageUpload.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mobile/ImageUpload.tsx b/src/mobile/ImageUpload.tsx
index bfc1738fc..33a615cbf 100644
--- a/src/mobile/ImageUpload.tsx
+++ b/src/mobile/ImageUpload.tsx
@@ -11,6 +11,7 @@ import { listSpec } from '../new_fields/Schema';
import { List } from '../new_fields/List';
import { observer } from 'mobx-react';
import { observable } from 'mobx';
+import { Utils } from '../Utils';
@@ -33,7 +34,7 @@ class Uploader extends React.Component {
onClick = async () => {
try {
this.status = "initializing protos";
- await Docs.initProtos();
+ await Docs.Prototypes.initialize();
let imgPrev = document.getElementById("img_preview");
if (imgPrev) {
let files: FileList | null = inputRef.current!.files;
@@ -53,11 +54,11 @@ class Uploader extends React.Component {
const json = await res.json();
json.map(async (file: any) => {
let path = window.location.origin + file;
- var doc = Docs.ImageDocument(path, { nativeWidth: 200, width: 200, title: name });
+ var doc = Docs.Create.ImageDocument(path, { nativeWidth: 200, width: 200, title: name });
this.status = "getting user document";
- const res = await rp.get(DocServer.prepend(RouteStore.getUserDocumentId));
+ const res = await rp.get(Utils.prepend(RouteStore.getUserDocumentId));
if (!res) {
throw new Error("No user id returned");
}
@@ -104,6 +105,8 @@ class Uploader extends React.Component {
}
+DocServer.init(window.location.protocol, window.location.hostname, 4321, "image upload");
+
ReactDOM.render((
<Uploader />
),