mirror of
https://github.com/wassname/talk.git
synced 2026-07-23 13:10:20 +08:00
Bug fixes
This commit is contained in:
@@ -7,11 +7,16 @@ import { getDefinitionName } from 'coral-framework/utils';
|
||||
|
||||
export default withQuery(
|
||||
gql`
|
||||
query TalkAdmin_Header {
|
||||
query TalkAdmin_Header($nullID: ID) {
|
||||
...${getDefinitionName(ModerationIndicator.fragments.root)}
|
||||
...${getDefinitionName(CommunityIndicator.fragments.root)}
|
||||
}
|
||||
${ModerationIndicator.fragments.root}
|
||||
${CommunityIndicator.fragments.root}
|
||||
`
|
||||
`,
|
||||
{
|
||||
options: {
|
||||
variables: { nullID: null },
|
||||
},
|
||||
}
|
||||
)(Header);
|
||||
|
||||
@@ -188,11 +188,14 @@ const enhance = compose(
|
||||
withFragments({
|
||||
root: gql`
|
||||
fragment TalkAdmin_Moderation_Indicator_root on RootQuery {
|
||||
premodCount: commentCount(query: { statuses: [PREMOD] })
|
||||
premodCount: commentCount(
|
||||
query: { statuses: [PREMOD], asset_id: $nullID }
|
||||
)
|
||||
reportedCount: commentCount(
|
||||
query: {
|
||||
statuses: [NONE, PREMOD, SYSTEM_WITHHELD]
|
||||
action_type: FLAG
|
||||
asset_id: $nullID
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -112,23 +112,12 @@ function getOlderDate(a, b) {
|
||||
function determineLatestChange(comment) {
|
||||
let lc = null;
|
||||
|
||||
// Skip it when comment itself was not updated.
|
||||
// We'll use the one from the status_history instead
|
||||
// as they might diverge a little bit (status_history item is created
|
||||
// before the comment itself)
|
||||
if (comment.createdAt !== comment.updatedAt) {
|
||||
lc = getOlderDate(lc, comment.createdAt);
|
||||
lc = getOlderDate(lc, comment.updatedAt);
|
||||
}
|
||||
|
||||
comment.status_history.forEach(item => {
|
||||
lc = getOlderDate(lc, item.created_at);
|
||||
lc = getOlderDate(lc, item.updated_at);
|
||||
});
|
||||
|
||||
comment.actions.forEach(item => {
|
||||
lc = getOlderDate(lc, item.created_at);
|
||||
lc = getOlderDate(lc, item.updated_at);
|
||||
});
|
||||
|
||||
return lc;
|
||||
|
||||
Reference in New Issue
Block a user