Fix comment create redirection

This commit is contained in:
saltrafael 2021-08-09 13:41:03 -03:00
parent 9d663b3789
commit 7ed0c59841
No known key found for this signature in database
GPG key ID: 9C7F1DC0B0F54515
2 changed files with 5 additions and 4 deletions

View file

@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Added \ and = to reserved symbol warning _community pr!_ ([#6733](https://github.com/lbryio/lbry-desktop/pull/6733))
- Don't break words in chat + fix text overflow past 3 dot menu _community pr!_ ([#6602](https://github.com/lbryio/lbry-desktop/pull/6602))
- Fix embed shows wrong OG metadata _community pr!_ ([#6815](https://github.com/lbryio/lbry-desktop/pull/6815))
- Fix comment section redirection to create channel _community pr!_ ([#6557](https://github.com/lbryio/lbry-desktop/pull/6557))
## [0.51.1] - [2021-06-26]

View file

@ -49,7 +49,6 @@ type Props = {
claimIsMine: boolean,
sendTip: ({}, (any) => void, (any) => void) => void,
doToast: ({ message: string }) => void,
disabled: boolean,
};
export function CommentCreate(props: Props) {
@ -90,7 +89,7 @@ export function CommentCreate(props: Props) {
const charCount = commentValue.length;
const [activeTab, setActiveTab] = React.useState('');
const [tipError, setTipError] = React.useState();
const disabled = isSubmitting || !activeChannelClaim || !commentValue.length;
const disabled = isSubmitting || isFetchingChannels || !commentValue.length;
const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState();
function handleCommentChange(event) {
@ -270,7 +269,7 @@ export function CommentCreate(props: Props) {
return <Empty padded text={__('This channel has disabled comments on their page.')} />;
}
if (!hasChannels) {
if (!isFetchingChannels && !hasChannels) {
return (
<div
role="button"
@ -348,7 +347,7 @@ export function CommentCreate(props: Props) {
})}
>
<FormField
disabled={!activeChannelClaim}
disabled={isFetchingChannels}
type={SIMPLE_SITE ? 'textarea' : advancedEditor && !isReply ? 'markdown' : 'textarea'}
name={isReply ? 'content_reply' : 'content_description'}
label={
@ -392,6 +391,7 @@ export function CommentCreate(props: Props) {
icon={activeTab === TAB_LBC ? ICONS.LBC : ICONS.FINANCE}
label={__('Review')}
onClick={() => setIsReviewingSupportComment(true)}
requiresAuth={IS_WEB}
/>
<Button disabled={disabled} button="link" label={__('Cancel')} onClick={() => setIsSupportComment(false)} />