From ffb4bf46cc70263a5488525d12ab152dc9911ccb Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Mon, 11 Feb 2019 17:51:17 -0500 Subject: [PATCH] fix: file path unavailable When clicking play, the file does re-download now, so no need to do anything there. Improved click behavior when file is deleted - it now still opens the folder in case someone is interested. --- src/renderer/component/fileDetails/view.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderer/component/fileDetails/view.jsx b/src/renderer/component/fileDetails/view.jsx index dba36a95a..7e71516b3 100644 --- a/src/renderer/component/fileDetails/view.jsx +++ b/src/renderer/component/fileDetails/view.jsx @@ -64,9 +64,12 @@ class FileDetails extends PureComponent { const mediaType = contentType || 'unknown'; let downloadPath = fileInfo && fileInfo.download_path ? path.normalize(fileInfo.download_path) : null; - // We should check if the file exists, and then show a better message, wtih an option to redownload. - if (fileInfo && fileInfo.download_path === null) - downloadPath = 'File may have been deleted or moved.'; + let downloadNote; + // If the path is blank, file is not avialable. Create path from name so the folder opens on click. + if (fileInfo && fileInfo.download_path === null) { + downloadPath = `${fileInfo.download_directory}/${fileInfo.file_name}`; + downloadNote = 'This file may have been moved or deleted'; + } return ( @@ -103,7 +106,7 @@ class FileDetails extends PureComponent {