fix dnd for some file types

This commit is contained in:
Sean Yesmunt 2020-05-28 10:45:56 -04:00
parent 8cf79ddf08
commit c2b80d3b3b
2 changed files with 32 additions and 25 deletions

View file

@ -181,15 +181,15 @@ function PublishFile(props: Props) {
setOversized(false);
// select file, start to select a new one, then cancel
if (!file || !file.type) {
if (!file) {
updatePublishForm({ filePath: '', name: '' });
return;
}
// if video, extract duration so we can warn about bitrateif (typeof file !== 'string') {
const contentType = file.type.split('/');
const isVideo = contentType[0] === 'video';
const isMp4 = contentType[1] === 'mp4';
const contentType = file.type && file.type.split('/');
const isVideo = contentType && contentType[0] === 'video';
const isMp4 = contentType && contentType[1] === 'mp4';
if (isVideo) {
if (isMp4) {
const video = document.createElement('video');

View file

@ -55,6 +55,7 @@ function FileListPublished(props: Props) {
return (
<Page>
<div className="card-stack">
<WebUploadList />
<Card
title={__('Publishes')}
@ -65,7 +66,12 @@ function FileListPublished(props: Props) {
label={__('Refresh')}
onClick={() => fetchClaimListMine(params.page, params.page_size)}
/>
<Button button="secondary" label={__('New Publish')} navigate="/$/publish" onClick={() => clearPublish()} />
<Button
button="secondary"
label={__('New Publish')}
navigate="/$/publish"
onClick={() => clearPublish()}
/>
</div>
}
isBodyList
@ -76,6 +82,7 @@ function FileListPublished(props: Props) {
</div>
}
/>
</div>
{!(urls && urls.length) && (
<React.Fragment>
{!fetching ? (