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