~Final~ Discovery fixes/cleanup #2599

Merged
neb-b merged 16 commits from discovery-fixes into master 2019-07-05 20:03:12 +02:00
Showing only changes of commit 1d79aa4537 - Show all commits

View file

@ -4,7 +4,9 @@ import React, { useState } from 'react';
import { FormField } from 'component/common/form';
import FileSelector from 'component/common/file-selector';
import Button from 'component/button';
// @if TARGET='app'
import fs from 'fs';
// @endif
import path from 'path';
import uuid from 'uuid/v4';
@ -34,6 +36,7 @@ function SelectAsset(props: Props) {
function doUploadAsset(filePath, thumbnailBuffer) {
let thumbnail, fileExt, fileName, fileType;
// @if TARGET='app'
if (filePath) {
thumbnail = fs.readFileSync(filePath);
fileExt = path.extname(filePath);
@ -47,6 +50,7 @@ function SelectAsset(props: Props) {
} else {
return null;
}
// @endif
const uploadError = (error = '') => {
console.log('error', error);