diff --git a/CHANGELOG.md b/CHANGELOG.md index e877d8506..534516ada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix sluggish Back button when navigation back to channels with lots of comments _community pr!_ ([#4576](https://github.com/lbryio/lbry-desktop/pull/4576)) - Fix 'Related' and 'Comments' section lazy-load not working in some scenarios _community pr!_ ([#4586](https://github.com/lbryio/lbry-desktop/pull/4586)) +- Fix comment-creation failure if you have recently deleted a channel _community pr!_ ([#4630](https://github.com/lbryio/lbry-desktop/pull/4630)) ## [0.47.1] - [2020-07-23] diff --git a/ui/component/selectChannel/view.jsx b/ui/component/selectChannel/view.jsx index 6c8237781..2191074c4 100644 --- a/ui/component/selectChannel/view.jsx +++ b/ui/component/selectChannel/view.jsx @@ -23,6 +23,8 @@ type State = { addingChannel: boolean, }; +const ID_FF_SELECT_CHANNEL = 'ID_FF_SELECT_CHANNEL'; + class ChannelSelection extends React.PureComponent { constructor(props: Props) { super(props); @@ -36,7 +38,7 @@ class ChannelSelection extends React.PureComponent { } componentDidMount() { - const { channels, fetchChannelListMine, fetchingChannels, emailVerified } = this.props; + const { channel, channels, fetchChannelListMine, fetchingChannels, emailVerified, onChannelChange } = this.props; if (IS_WEB && !emailVerified) { return; } @@ -44,6 +46,15 @@ class ChannelSelection extends React.PureComponent { if ((!channels || !channels.length) && !fetchingChannels) { fetchChannelListMine(); } + + const elem = document.getElementById(ID_FF_SELECT_CHANNEL); + // $FlowFixMe + if (elem && elem.value && elem.value !== channel) { + setTimeout(() => { + // $FlowFixMe + onChannelChange(elem.value); + }, 250); + } } componentDidUpdate() { @@ -84,6 +95,7 @@ class ChannelSelection extends React.PureComponent { return (