fix: comment create without existing channel

This commit is contained in:
Thomas Zarebczan 2019-10-14 22:08:37 -04:00
parent 9919a81509
commit b11eb3262b
2 changed files with 3 additions and 2 deletions

2
dist/bundle.es.js vendored
View file

@ -3854,7 +3854,7 @@ function doCommentCreate(comment = '', claim_id = '', channel, parent_id) {
type: COMMENT_CREATE_STARTED
});
const myChannels = selectMyChannelClaims(state);
const namedChannelClaim = myChannels.find(myChannel => myChannel.name === channel);
const namedChannelClaim = myChannels && myChannels.find(myChannel => myChannel.name === channel);
const channel_id = namedChannelClaim ? namedChannelClaim.claim_id : null;
return lbryProxy.comment_create({
comment,

View file

@ -48,7 +48,8 @@ export function doCommentCreate(
type: ACTIONS.COMMENT_CREATE_STARTED,
});
const myChannels = selectMyChannelClaims(state);
const namedChannelClaim = myChannels.find(myChannel => myChannel.name === channel);
const namedChannelClaim =
myChannels && myChannels.find(myChannel => myChannel.name === channel);
const channel_id = namedChannelClaim ? namedChannelClaim.claim_id : null;
return Lbry.comment_create({
comment,