From f65f6c1b28cc5ee54d91ed40b7caa387fafdeee6 Mon Sep 17 00:00:00 2001 From: keyan Date: Thu, 1 Sep 2022 16:20:20 -0500 Subject: [PATCH] remove meComments and clean up sats title --- api/resolvers/item.js | 5 ----- api/typeDefs/item.js | 1 - components/comment.js | 4 ++-- components/item-full.js | 4 ++-- components/item.js | 2 +- components/reply.js | 7 +------ fragments/comments.js | 1 - fragments/items.js | 2 -- 8 files changed, 6 insertions(+), 20 deletions(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 6a930e37..c4b01830 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -768,11 +768,6 @@ export default { return sats || 0 }, - meComments: async (item, args, { me, models }) => { - if (!me) return 0 - - return await models.item.count({ where: { userId: me.id, parentId: item.id } }) - }, mine: async (item, args, { me, models }) => { return me?.id === item.userId }, diff --git a/api/typeDefs/item.js b/api/typeDefs/item.js index 1c6cb937..274b3b36 100644 --- a/api/typeDefs/item.js +++ b/api/typeDefs/item.js @@ -79,7 +79,6 @@ export default gql` upvotes: Int! meSats: Int! paidImgLink: Boolean - meComments: Int! ncomments: Int! comments: [Item!]! path: String diff --git a/components/comment.js b/components/comment.js index db840e80..a258e3a4 100644 --- a/components/comment.js +++ b/components/comment.js @@ -109,7 +109,7 @@ export default function Comment ({
- {item.sats} sats + {item.sats} sats \ {item.boost > 0 && <> @@ -186,7 +186,7 @@ export default function Comment ({
{!noReply && } {children}
diff --git a/components/item-full.js b/components/item-full.js index bf7ce2f3..30ce000f 100644 --- a/components/item-full.js +++ b/components/item-full.js @@ -31,7 +31,7 @@ function BioItem ({ item, handleClick }) { >edit bio
} - + ) } @@ -89,7 +89,7 @@ function TopLevelItem ({ item, noReply, ...props }) { {item.text && } {item.url && } {item.poll && } - {!noReply && } + {!noReply && } ) } diff --git a/components/item.js b/components/item.js index c9bf3ffe..0d57e74a 100644 --- a/components/item.js +++ b/components/item.js @@ -73,7 +73,7 @@ export default function Item ({ item, rank, showFwdUser, toc, children }) {
{!item.position && <> - {item.sats} sats + {item.sats} sats \ } {item.boost > 0 && diff --git a/components/reply.js b/components/reply.js index d97d2c07..9eee8796 100644 --- a/components/reply.js +++ b/components/reply.js @@ -21,7 +21,7 @@ export function ReplyOnAnotherPage ({ parentId }) { ) } -export default function Reply ({ parentId, meComments, onSuccess, replyOpen }) { +export default function Reply ({ parentId, onSuccess, replyOpen }) { const [reply, setReply] = useState(replyOpen) const me = useMe() const [hasImgLink, setHasImgLink] = useState() @@ -55,9 +55,6 @@ export default function Reply ({ parentId, meComments, onSuccess, replyOpen }) { }, ncomments (existingNComments = 0) { return existingNComments + 1 - }, - meComments (existingMeComments = 0) { - return existingMeComments + 1 } } }) @@ -65,8 +62,6 @@ export default function Reply ({ parentId, meComments, onSuccess, replyOpen }) { } ) - // const cost = me?.freeComments ? 0 : Math.pow(10, meComments) - return (
{replyOpen diff --git a/fragments/comments.js b/fragments/comments.js index 340b1e1c..58793a99 100644 --- a/fragments/comments.js +++ b/fragments/comments.js @@ -14,7 +14,6 @@ export const COMMENT_FIELDS = gql` upvotes boost meSats - meComments path mine paidImgLink diff --git a/fragments/items.js b/fragments/items.js index c3981a11..3196d896 100644 --- a/fragments/items.js +++ b/fragments/items.js @@ -111,7 +111,6 @@ export const ITEM_FULL = gql` item(id: $id) { ...ItemFields prior - meComments position text ...PollFields @@ -127,7 +126,6 @@ export const ITEM_WITH_COMMENTS = gql` fragment ItemWithComments on Item { ...ItemFields text - meComments comments { ...CommentsRecursive }