From f31369a16d3fba02f0b58e58e03984d8cd41438f Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Tue, 14 Jul 2020 18:32:08 +0800 Subject: [PATCH] Fix 'transcoding' checkbox state when switching file types. ## Issue: Currently, the checkbox grayed-out state is only correctly updated when changing from "no-file" to "file selected". If you have selected a video file and later changed to a text file, the checkbox doesn't gray out. ## Code Changes: `fileVid` wasn't being updated for the case of non-videos; now it does. --- CHANGELOG.md | 2 ++ ui/component/publishFile/view.jsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 452e04c5c..987253793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- Fix 'transcoding' checkbox state when switching file types _community pr!_ ([#4529](https://github.com/lbryio/lbry-desktop/pull/4529)) + ## [0.47.0] - [2020-07-13] ### Added diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index 0b1e89077..c6d9e0b2b 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -82,7 +82,7 @@ function PublishFile(props: Props) { setOptimizeAvail(isOptimizeAvail); updatePublishForm({ optimize: finalOptimizeState }); - }, [filePath, isVid, ffmpegAvail, userOptimize]); + }, [currentFile, filePath, isVid, ffmpegAvail, userOptimize]); function updateFileInfo(duration, size, isvid) { updatePublishForm({ fileDur: duration, fileSize: size, fileVid: isvid }); @@ -216,6 +216,8 @@ function PublishFile(props: Props) { } else { updateFileInfo(0, file.size, isVideo); } + } else { + updateFileInfo(0, file.size, isVideo); } // @if TARGET='web'