Skip to content

Commit

Permalink
Fix issue with wording and invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jul 15, 2024
1 parent 93631a2 commit 81d5ae5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/components/modals/MemeOnReviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default function MemeOnReviewModal({
enabled: props.isOpen,
}
)
const remaining = MIN_MEME_FOR_REVIEW - (count?.unapproved ?? 0)
const sentMeme = (count?.unapproved ?? 0) + (count?.approved ?? 0)
const remaining = MIN_MEME_FOR_REVIEW - sentMeme

const description =
remaining > 0
Expand All @@ -32,7 +33,7 @@ export default function MemeOnReviewModal({
: `${
tokenomics?.socialActionPrice.createCommentPoints
} points have been used. We received ${
count?.unapproved ?? 0
sentMeme ?? 0
} memes from you! Now we need a bit of time to finish review you as a verified creator.`

return (
Expand Down
3 changes: 1 addition & 2 deletions src/services/datahub/events/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ async function processSubscriptionEvent(

if (eventData.meta.callName === SocialCallName.SynthSetPostApproveStatus) {
const extension = eventData.meta.extension
const updatedPostId = extension?.postId ?? ''
const creatorAddress = extension?.creatorAddress ?? ''
const rootPostId = extension?.rootPostId ?? ''
const profile = getProfileQuery.getQueryData(client, creatorAddress)
Expand All @@ -255,8 +254,8 @@ async function processSubscriptionEvent(
if (!oldCount) return oldCount
return {
...oldCount,
ids: [...oldCount.ids, updatedPostId],
approved: oldCount.approved + 1,
unapproved: oldCount.unapproved - 1,
}
}
)
Expand Down
11 changes: 4 additions & 7 deletions src/services/datahub/posts/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ async function processMessage(
queryClient,
{ address: myAddress, chatId: rootPostId ?? '' }
)
if (count.unapproved === 1 || count.unapproved === 3) {
const sentMeme = count.approved + count.unapproved
if (sentMeme === 1 || sentMeme === 3) {
useMessageData.getState().setOpenMessageModal('on-review')
} else {
const remaining = Math.max(
MIN_MEME_FOR_REVIEW - (count.unapproved ?? 0),
MIN_MEME_FOR_REVIEW - (sentMeme ?? 0),
0
)
const title = 'Under review'
Expand All @@ -254,11 +255,7 @@ async function processMessage(
} points have been used. We received your meme! We need at least ${remaining} more meme${
remaining > 1 ? 's' : ''
} from you to mark you as a verified creator.`
: `${
tokenomics.socialActionPrice.createCommentPoints
} points have been used. We received ${
count ?? 0
} memes from you! Now we need a bit of time to finish review you as a verified creator.`
: `${tokenomics.socialActionPrice.createCommentPoints} points have been used. We received ${sentMeme} memes from you! Now we need a bit of time to finish review you as a verified creator.`
toast.custom((t) => (
<Toast
t={t}
Expand Down

0 comments on commit 81d5ae5

Please sign in to comment.