From c2b80d3b3b57594cc9a7d7e35a0bf42e0d426d88 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 28 May 2020 10:45:56 -0400 Subject: [PATCH] fix dnd for some file types --- ui/component/publishFile/view.jsx | 8 ++--- ui/page/fileListPublished/view.jsx | 49 +++++++++++++++++------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index 21691c7de..ac4e504a6 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -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'); diff --git a/ui/page/fileListPublished/view.jsx b/ui/page/fileListPublished/view.jsx index 07b231559..497c5ff34 100644 --- a/ui/page/fileListPublished/view.jsx +++ b/ui/page/fileListPublished/view.jsx @@ -55,27 +55,34 @@ function FileListPublished(props: Props) { return ( - - -