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,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 ? (