mirror of
https://github.com/wassname/talk.git
synced 2026-07-11 03:19:48 +08:00
Check existance of featuredComments in query
This commit is contained in:
@@ -26,6 +26,9 @@ export default {
|
||||
IgnoreUser: ({variables}) => ({
|
||||
updateQueries: {
|
||||
CoralEmbedStream_Embed: (previous) => {
|
||||
if (!previous.asset.featuredComments) {
|
||||
return previous;
|
||||
}
|
||||
const ignoredUserId = variables.id;
|
||||
const newNodes = previous.asset.featuredComments.nodes.filter((n) => n.user.id !== ignoredUserId);
|
||||
const removedCount = previous.asset.featuredComments.nodes.length - newNodes.length;
|
||||
|
||||
Reference in New Issue
Block a user