Skip to content

Commit

Permalink
Fix inability to comment on Anonymous claims
Browse files Browse the repository at this point in the history
Closes 2993

It was trying to prevent sending the comment when membership data is missing, say on fetch failure (hence the snack to reload). But the path for anonymous claims ended up in the same place
  • Loading branch information
infinite-persistence committed Oct 12, 2023
1 parent 03e45ba commit f5d31f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/component/commentCreate/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ export function CommentCreate(props: Props) {
// Functions
// **************************************************************************

function getMembersOnlyCreatorSetting() {
function isRestrictedToMembersOnly() {
const isAnonymous = claimId && !channelClaimId;
if (isAnonymous) {
return false;
}

return (
channelClaimId &&
doFetchCreatorSettings(channelClaimId)
Expand Down Expand Up @@ -355,7 +360,7 @@ export function CommentCreate(props: Props) {
}

// do another creator settings fetch here to make sure that on submit, the setting did not change
const commentsAreMembersOnly = await getMembersOnlyCreatorSetting();
const commentsAreMembersOnly = await isRestrictedToMembersOnly();
if (commentsAreMembersOnly === undefined) {
doToast({
message: __('Unable to send the comment.'),
Expand Down Expand Up @@ -476,7 +481,7 @@ export function CommentCreate(props: Props) {
if (isSubmitting || disableInput || !claimId) return;

// do another creator settings fetch here to make sure that on submit, the setting did not change
const commentsAreMembersOnly = await getMembersOnlyCreatorSetting();
const commentsAreMembersOnly = await isRestrictedToMembersOnly();
if (commentsAreMembersOnly === undefined) {
doToast({
message: __('Unable to send the comment.'),
Expand Down

0 comments on commit f5d31f4

Please sign in to comment.