This commit is contained in:
Rafael 2022-01-27 13:27:54 -03:00 committed by Thomas Zarebczan
parent 6544f4c0b6
commit 898376888d

View file

@ -488,7 +488,7 @@ export function doCommentCreate(
return async (dispatch: Dispatch, getState: GetState) => { return async (dispatch: Dispatch, getState: GetState) => {
const state = getState(); const state = getState();
const activeChannelClaim = selectActiveChannelClaim(state); const activeChannelClaim = selectActiveChannelClaim(state);
let mentionedChannels: Array<MentionedChannel> = []; const mentionedChannels: Array<MentionedChannel> = [];
if (!activeChannelClaim) { if (!activeChannelClaim) {
console.error('Unable to create comment. No activeChannel is set.'); // eslint-disable-line console.error('Unable to create comment. No activeChannel is set.'); // eslint-disable-line
@ -513,7 +513,7 @@ export function doCommentCreate(
if (claim) { if (claim) {
mentionedChannels.push({ channel_name: claim.name, channel_id: claim.claim_id }); mentionedChannels.push({ channel_name: claim.name, channel_id: claim.claim_id });
} else if (claim === undefined) { } else {
mentionUrls.push(mentionUri); mentionUrls.push(mentionUri);
} }
}); });
@ -521,9 +521,11 @@ export function doCommentCreate(
if (mentionUrls.length > 0) { if (mentionUrls.length > 0) {
await dispatch(doResolveUris(mentionUrls, true)) await dispatch(doResolveUris(mentionUrls, true))
.then((response) => { .then((response) => {
mentionedChannels = Object.values(response).map((claim) => { Object.values(response).map((claim) => {
// $FlowFixMe if (claim) {
return { channel_name: claim.name, channel_id: claim.claim_id }; // $FlowFixMe
mentionedChannels.push({ channel_name: claim.name, channel_id: claim.claim_id });
}
}); });
}) })
.catch((e) => {}); .catch((e) => {});