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);
|
||||
|
||||
// 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');
|
||||
|
|
|
@ -55,27 +55,34 @@ function FileListPublished(props: Props) {
|
|||
|
||||
return (
|
||||
<Page>
|
||||
<WebUploadList />
|
||||
<Card
|
||||
title={__('Publishes')}
|
||||
titleActions={
|
||||
<div className="card__actions--inline">
|
||||
<Button
|
||||
button="alt"
|
||||
label={__('Refresh')}
|
||||
onClick={() => fetchClaimListMine(params.page, params.page_size)}
|
||||
/>
|
||||
<Button button="secondary" label={__('New Publish')} navigate="/$/publish" onClick={() => clearPublish()} />
|
||||
</div>
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div>
|
||||
<ClaimList isCardBody loading={fetching} persistedStorageKey="claim-list-published" uris={urls} />
|
||||
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<div className="card-stack">
|
||||
<WebUploadList />
|
||||
<Card
|
||||
title={__('Publishes')}
|
||||
titleActions={
|
||||
<div className="card__actions--inline">
|
||||
<Button
|
||||
button="alt"
|
||||
label={__('Refresh')}
|
||||
onClick={() => fetchClaimListMine(params.page, params.page_size)}
|
||||
/>
|
||||
<Button
|
||||
button="secondary"
|
||||
label={__('New Publish')}
|
||||
navigate="/$/publish"
|
||||
onClick={() => clearPublish()}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
isBodyList
|
||||
body={
|
||||
<div>
|
||||
<ClaimList isCardBody loading={fetching} persistedStorageKey="claim-list-published" uris={urls} />
|
||||
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{!(urls && urls.length) && (
|
||||
<React.Fragment>
|
||||
{!fetching ? (
|
||||
|
|
Loading…
Reference in a new issue