diff options
author | andrewdkim <adkim414@gmail.com> | 2019-07-19 11:21:47 -0400 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-07-19 11:21:47 -0400 |
commit | e453e7010def252b6cc10ad49d64708767c5589b (patch) | |
tree | 4353a4be5495acd61d813066d001e2b12da7d207 /src/mobile/ImageUpload.tsx | |
parent | 9cad9abcf164c7d81b8debf4aa2639d83edd227b (diff) | |
parent | 8854d3277541a67aef4187b5d3592bea5a7fcfa2 (diff) |
merge from master
Diffstat (limited to 'src/mobile/ImageUpload.tsx')
-rw-r--r-- | src/mobile/ImageUpload.tsx | 9 |
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 /> ), |