Rename insertSorted to insertCommentSorted

This commit is contained in:
Chi Vinh Le
2017-07-18 19:38:52 +07:00
parent 636d1f4788
commit 99fc67d0d9
2 changed files with 3 additions and 3 deletions
@@ -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);
@@ -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: {