remove meComments and clean up sats title
This commit is contained in:
		
							parent
							
								
									4be5cfa5c7
								
							
						
					
					
						commit
						f65f6c1b28
					
				@ -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
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -79,7 +79,6 @@ export default gql`
 | 
			
		||||
    upvotes: Int!
 | 
			
		||||
    meSats: Int!
 | 
			
		||||
    paidImgLink: Boolean
 | 
			
		||||
    meComments: Int!
 | 
			
		||||
    ncomments: Int!
 | 
			
		||||
    comments: [Item!]!
 | 
			
		||||
    path: String
 | 
			
		||||
 | 
			
		||||
@ -109,7 +109,7 @@ export default function Comment ({
 | 
			
		||||
        <div className={`${itemStyles.hunk} ${styles.hunk}`}>
 | 
			
		||||
          <div className='d-flex align-items-center'>
 | 
			
		||||
            <div className={`${itemStyles.other} ${styles.other}`}>
 | 
			
		||||
              <span title={`from ${item.upvotes} users (${item.meSats} from me)`}>{item.sats} sats</span>
 | 
			
		||||
              <span title={`from ${item.upvotes} users ${item.mine ? `\\ ${item.meSats} sats to post` : `(${item.meSats} sats from me)`}`}>{item.sats} sats</span>
 | 
			
		||||
              <span> \ </span>
 | 
			
		||||
              {item.boost > 0 &&
 | 
			
		||||
                <>
 | 
			
		||||
@ -186,7 +186,7 @@ export default function Comment ({
 | 
			
		||||
          <div className={`${styles.children}`}>
 | 
			
		||||
            {!noReply &&
 | 
			
		||||
              <Reply
 | 
			
		||||
                depth={depth + 1} parentId={item.id} meComments={item.meComments} replyOpen={replyOpen}
 | 
			
		||||
                depth={depth + 1} parentId={item.id} replyOpen={replyOpen}
 | 
			
		||||
              />}
 | 
			
		||||
            {children}
 | 
			
		||||
            <div className={`${styles.comments} ml-sm-1 ml-md-3`}>
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,7 @@ function BioItem ({ item, handleClick }) {
 | 
			
		||||
          >edit bio
 | 
			
		||||
          </Button>
 | 
			
		||||
        </div>}
 | 
			
		||||
      <Reply parentId={item.id} meComments={item.meComments} />
 | 
			
		||||
      <Reply parentId={item.id} />
 | 
			
		||||
    </>
 | 
			
		||||
  )
 | 
			
		||||
}
 | 
			
		||||
@ -89,7 +89,7 @@ function TopLevelItem ({ item, noReply, ...props }) {
 | 
			
		||||
      {item.text && <ItemText item={item} />}
 | 
			
		||||
      {item.url && <ItemEmbed item={item} />}
 | 
			
		||||
      {item.poll && <Poll item={item} />}
 | 
			
		||||
      {!noReply && <Reply parentId={item.id} meComments={item.meComments} replyOpen />}
 | 
			
		||||
      {!noReply && <Reply parentId={item.id} replyOpen />}
 | 
			
		||||
    </ItemComponent>
 | 
			
		||||
  )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ export default function Item ({ item, rank, showFwdUser, toc, children }) {
 | 
			
		||||
          <div className={`${styles.other}`}>
 | 
			
		||||
            {!item.position &&
 | 
			
		||||
              <>
 | 
			
		||||
                <span title={`from ${item.upvotes} users (${item.meSats} sats from me)`}>{item.sats} sats</span>
 | 
			
		||||
                <span title={`from ${item.upvotes} users ${item.mine ? `\\ ${item.meSats} sats to post` : `(${item.meSats} sats from me)`} `}>{item.sats} sats</span>
 | 
			
		||||
                <span> \ </span>
 | 
			
		||||
              </>}
 | 
			
		||||
            {item.boost > 0 &&
 | 
			
		||||
 | 
			
		||||
@ -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 (
 | 
			
		||||
    <div>
 | 
			
		||||
      {replyOpen
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,6 @@ export const COMMENT_FIELDS = gql`
 | 
			
		||||
    upvotes
 | 
			
		||||
    boost
 | 
			
		||||
    meSats
 | 
			
		||||
    meComments
 | 
			
		||||
    path
 | 
			
		||||
    mine
 | 
			
		||||
    paidImgLink
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user