fix dnd for some file types
This commit is contained in:
parent
8cf79ddf08
commit
c2b80d3b3b
2 changed files with 32 additions and 25 deletions
|
@ -181,15 +181,15 @@ function PublishFile(props: Props) {
|
||||||
setOversized(false);
|
setOversized(false);
|
||||||
|
|
||||||
// select file, start to select a new one, then cancel
|
// select file, start to select a new one, then cancel
|
||||||
if (!file || !file.type) {
|
if (!file) {
|
||||||
updatePublishForm({ filePath: '', name: '' });
|
updatePublishForm({ filePath: '', name: '' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if video, extract duration so we can warn about bitrateif (typeof file !== 'string') {
|
// if video, extract duration so we can warn about bitrateif (typeof file !== 'string') {
|
||||||
const contentType = file.type.split('/');
|
const contentType = file.type && file.type.split('/');
|
||||||
const isVideo = contentType[0] === 'video';
|
const isVideo = contentType && contentType[0] === 'video';
|
||||||
const isMp4 = contentType[1] === 'mp4';
|
const isMp4 = contentType && contentType[1] === 'mp4';
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
if (isMp4) {
|
if (isMp4) {
|
||||||
const video = document.createElement('video');
|
const video = document.createElement('video');
|
||||||
|
|
|
@ -55,6 +55,7 @@ function FileListPublished(props: Props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
|
<div className="card-stack">
|
||||||
<WebUploadList />
|
<WebUploadList />
|
||||||
<Card
|
<Card
|
||||||
title={__('Publishes')}
|
title={__('Publishes')}
|
||||||
|
@ -65,7 +66,12 @@ function FileListPublished(props: Props) {
|
||||||
label={__('Refresh')}
|
label={__('Refresh')}
|
||||||
onClick={() => fetchClaimListMine(params.page, params.page_size)}
|
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>
|
</div>
|
||||||
}
|
}
|
||||||
isBodyList
|
isBodyList
|
||||||
|
@ -76,6 +82,7 @@ function FileListPublished(props: Props) {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
{!(urls && urls.length) && (
|
{!(urls && urls.length) && (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{!fetching ? (
|
{!fetching ? (
|
||||||
|
|
Loading…
Reference in a new issue