mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 05:17:42 +08:00
Don't sort and ignore duplicate comments (embed-stream)
This commit is contained in:
@@ -6,7 +6,7 @@ import {withFragments, connect} from 'plugin-api/beta/client/hocs';
|
||||
import Comment from '../containers/Comment';
|
||||
import {addNotification} from 'plugin-api/beta/client/actions/notification';
|
||||
import {viewComment} from 'coral-embed-stream/src/actions/stream';
|
||||
import {getDefinitionName} from 'plugin-api/beta/client/utils';
|
||||
import {appendNewNodes, getDefinitionName} from 'plugin-api/beta/client/utils';
|
||||
import update from 'immutability-helper';
|
||||
|
||||
class TabPaneContainer extends React.Component {
|
||||
@@ -27,7 +27,7 @@ class TabPaneContainer extends React.Component {
|
||||
asset: {
|
||||
featuredComments: {
|
||||
nodes: {
|
||||
$push: comments.nodes,
|
||||
$apply: (nodes) => appendNewNodes(nodes, comments.nodes),
|
||||
},
|
||||
hasNextPage: {$set: comments.hasNextPage},
|
||||
endCursor: {$set: comments.endCursor},
|
||||
|
||||
@@ -9,7 +9,7 @@ import ModTag from './containers/ModTag';
|
||||
import ModSubscription from './containers/ModSubscription';
|
||||
|
||||
import {findCommentInEmbedQuery} from 'coral-embed-stream/src/graphql/utils';
|
||||
import {insertCommentsSorted} from 'plugin-api/beta/client/utils';
|
||||
import {prependNewNodes} from 'plugin-api/beta/client/utils';
|
||||
|
||||
export default {
|
||||
reducer,
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
asset: {
|
||||
featuredComments: {
|
||||
nodes: {
|
||||
$apply: (nodes) => insertCommentsSorted(nodes, comment, 'DESC')
|
||||
$apply: (nodes) => prependNewNodes(nodes, [comment]),
|
||||
}
|
||||
},
|
||||
featuredCommentsCount: {
|
||||
|
||||
Reference in New Issue
Block a user