Fix comment create redirection #6557

Merged
saltrafael merged 1 commit from comments_redirect into master 2021-08-17 04:48:03 +02:00
2 changed files with 5 additions and 4 deletions

View file

@ -37,6 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix embed shows wrong OG metadata _community pr!_ ([#6815](https://github.com/lbryio/lbry-desktop/pull/6815)) - Fix embed shows wrong OG metadata _community pr!_ ([#6815](https://github.com/lbryio/lbry-desktop/pull/6815))
- Fix OG: "Unparsable data structure - Truncated Unicode character" _community pr!_ ([#6839](https://github.com/lbryio/lbry-desktop/pull/6839)) - Fix OG: "Unparsable data structure - Truncated Unicode character" _community pr!_ ([#6839](https://github.com/lbryio/lbry-desktop/pull/6839))
- Fix Paid embed warning overlay redirection button now links to odysee _community pr!_ ([#6819](https://github.com/lbryio/lbry-desktop/pull/6819)) - Fix Paid embed warning overlay redirection button now links to odysee _community pr!_ ([#6819](https://github.com/lbryio/lbry-desktop/pull/6819))
- Fix comment section redirection to create channel _community pr!_ ([#6557](https://github.com/lbryio/lbry-desktop/pull/6557))
## [0.51.1] - [2021-06-26] ## [0.51.1] - [2021-06-26]

View file

@ -51,7 +51,6 @@ type Props = {
claimIsMine: boolean, claimIsMine: boolean,
sendTip: ({}, (any) => void, (any) => void) => void, sendTip: ({}, (any) => void, (any) => void) => void,
doToast: ({ message: string }) => void, doToast: ({ message: string }) => void,
disabled: boolean,
doFetchCreatorSettings: (channelId: string) => Promise<any>, doFetchCreatorSettings: (channelId: string) => Promise<any>,
settingsByChannelId: { [channelId: string]: PerChannelSettings }, settingsByChannelId: { [channelId: string]: PerChannelSettings },
}; };
@ -95,7 +94,7 @@ export function CommentCreate(props: Props) {
const charCount = commentValue.length; const charCount = commentValue.length;
const [activeTab, setActiveTab] = React.useState(''); const [activeTab, setActiveTab] = React.useState('');
const [tipError, setTipError] = React.useState(); const [tipError, setTipError] = React.useState();
const disabled = isSubmitting || !activeChannelClaim || !commentValue.length; const disabled = isSubmitting || isFetchingChannels || !commentValue.length;
const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState(); const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState();
const channelId = getChannelIdFromClaim(claim); const channelId = getChannelIdFromClaim(claim);
const channelSettings = channelId ? settingsByChannelId[channelId] : undefined; const channelSettings = channelId ? settingsByChannelId[channelId] : undefined;
@ -370,7 +369,7 @@ export function CommentCreate(props: Props) {
return <Empty padded text={__('This channel has disabled comments on their page.')} />; return <Empty padded text={__('This channel has disabled comments on their page.')} />;
} }
if (!hasChannels) { if (!isFetchingChannels && !hasChannels) {
return ( return (
<div <div
role="button" role="button"
@ -454,7 +453,7 @@ export function CommentCreate(props: Props) {
})} })}
> >
<FormField <FormField
disabled={!activeChannelClaim} disabled={isFetchingChannels}
type={SIMPLE_SITE ? 'textarea' : advancedEditor && !isReply ? 'markdown' : 'textarea'} type={SIMPLE_SITE ? 'textarea' : advancedEditor && !isReply ? 'markdown' : 'textarea'}
name={isReply ? 'content_reply' : 'content_description'} name={isReply ? 'content_reply' : 'content_description'}
label={ label={
@ -498,6 +497,7 @@ export function CommentCreate(props: Props) {
icon={activeTab === TAB_LBC ? ICONS.LBC : ICONS.FINANCE} icon={activeTab === TAB_LBC ? ICONS.LBC : ICONS.FINANCE}
label={__('Review')} label={__('Review')}
onClick={() => setIsReviewingSupportComment(true)} onClick={() => setIsReviewingSupportComment(true)}
requiresAuth={IS_WEB}
/> />
<Button disabled={disabled} button="link" label={__('Cancel')} onClick={() => setIsSupportComment(false)} /> <Button disabled={disabled} button="link" label={__('Cancel')} onClick={() => setIsSupportComment(false)} />