mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
Rename insertSorted to insertCommentSorted
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user