From ca4dd9e246cf7a99c630a69d66fce5819f19c6f3 Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Thu, 16 Jul 2020 15:13:49 +0800 Subject: [PATCH] New Channel: Fix incorrect GUI configuration at entry ## Issue: Fixes 4411 `"SelectChannel=New" doesn't show all fields on re-entry` ## Code Changes: `selectChannel`: Correct the value of `addingChannel` in the constructor based on the given props. --- CHANGELOG.md | 1 + ui/component/selectChannel/view.jsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faff9d96a..bace21be7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix 'transcoding' checkbox state when switching file types _community pr!_ ([#4529](https://github.com/lbryio/lbry-desktop/pull/4529)) - Fix channel file-search not available in mobile _community pr!_ ([#4527](https://github.com/lbryio/lbry-desktop/pull/4527)) +- New Channel: Fix incorrect GUI configuration at entry _community pr!_ ([#4545](https://github.com/lbryio/lbry-desktop/pull/4545)) ## [0.47.0] - [2020-07-13] diff --git a/ui/component/selectChannel/view.jsx b/ui/component/selectChannel/view.jsx index f864b5899..6c8237781 100644 --- a/ui/component/selectChannel/view.jsx +++ b/ui/component/selectChannel/view.jsx @@ -28,7 +28,7 @@ class ChannelSelection extends React.PureComponent { super(props); this.state = { - addingChannel: false, + addingChannel: props.channel === CHANNEL_NEW, }; (this: any).handleChannelChange = this.handleChannelChange.bind(this); @@ -77,7 +77,7 @@ class ChannelSelection extends React.PureComponent { } render() { - const channel = this.state.addingChannel ? 'new' : this.props.channel; + const channel = this.state.addingChannel ? CHANNEL_NEW : this.props.channel; const { fetchingChannels, channels = [], hideAnon, hideNew, label, injected = [] } = this.props; const { addingChannel } = this.state;