From 99fc67d0d9aa8e66a29d6a792ed483732425b6b9 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 18 Jul 2017 19:38:52 +0700 Subject: [PATCH] Rename insertSorted to insertCommentSorted --- client/coral-embed-stream/src/graphql/utils.js | 2 +- plugins/talk-plugin-featured-comments/client/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/coral-embed-stream/src/graphql/utils.js b/client/coral-embed-stream/src/graphql/utils.js index bd174dc98..5738785fb 100644 --- a/client/coral-embed-stream/src/graphql/utils.js +++ b/client/coral-embed-stream/src/graphql/utils.js @@ -152,7 +152,7 @@ const ascending = (a, b) => { const descending = (a, b) => ascending(a, b) * -1; -export function insertSorted(nodes, comment, sortOrder = 'CHRONOLOGICAL') { +export function insertCommentSorted(nodes, comment, sortOrder = 'CHRONOLOGICAL') { const added = nodes.concat(comment); if (sortOrder === 'CHRONOLOGICAL') { return added.sort(ascending); diff --git a/plugins/talk-plugin-featured-comments/client/index.js b/plugins/talk-plugin-featured-comments/client/index.js index 18ec28901..1c5d2cb82 100644 --- a/plugins/talk-plugin-featured-comments/client/index.js +++ b/plugins/talk-plugin-featured-comments/client/index.js @@ -5,7 +5,7 @@ import FeaturedButton from './components/FeaturedButton'; import translations from './translations.json'; import update from 'immutability-helper'; -import {findCommentInEmbedQuery, insertSorted} from 'plugin-api/beta/client/utils/stream'; +import {findCommentInEmbedQuery, insertCommentSorted} from 'plugin-api/beta/client/utils/stream'; export default { translations, @@ -51,7 +51,7 @@ export default { asset: { featuredComments: { nodes: { - $apply: (nodes) => insertSorted(nodes, comment, 'REVERSE_CHRONOLOGICAL') + $apply: (nodes) => insertCommentSorted(nodes, comment, 'REVERSE_CHRONOLOGICAL') } }, featuredCommentsCount: {