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: {