Merge pull request #798 from coralproject/live-reactions-no-comment

Live Reactions should not always expect the comment to be there.
This commit is contained in:
Kim Gardner
2017-07-26 14:52:08 -04:00
committed by GitHub
@@ -54,6 +54,13 @@ export default (reaction) => (WrappedComponent) => {
id: fragmentId
});
if (!data) {
if (self) {
throw new Error(`Comment ${action.item_id} was not found`);
}
return;
}
// Add our comment from the mutation to the end.
let idx = data.action_summaries.findIndex(isReaction);
@@ -96,6 +103,13 @@ export default (reaction) => (WrappedComponent) => {
id: fragmentId
});
if (!data) {
if (self) {
throw new Error(`Comment ${action.item_id} was not found`);
}
return;
}
// Check whether we liked this comment.
const idx = data.action_summaries.findIndex(isReaction);