Live Reactions should not always expect the comment to be there.

This commit is contained in:
Chi Vinh Le
2017-07-25 19:26:44 +07:00
parent 34e484abf3
commit 039b620ecf
@@ -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);