-
Notifications
You must be signed in to change notification settings - Fork 264
feat: support clicking post boost notification #4691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Modal Hook Fails with Array Query Parameters
The useCampaignByIdModal
hook unsafely casts campaignId
to string
. Next.js router query parameters (c_id
, post_boost
) can be string | string[] | undefined
. If multiple c_id
or post_boost
parameters are present in the URL, the corresponding value will be an array (e.g., ['123', '456']
). The as string
assertion converts this array to a comma-separated string (e.g., '123,456'
), which is not the expected single ID format for the FetchBoostedPostView
modal, leading to incorrect behavior.
packages/shared/src/hooks/notifications/useCampaignByIdModal.ts#L10-L23
apps/packages/shared/src/hooks/notifications/useCampaignByIdModal.ts
Lines 10 to 23 in 828c4f3
const { | |
query: { post_boost: postBoost, c_id: campaignId }, | |
replace, | |
pathname, | |
} = useRouter(); | |
useEffect(() => { | |
if (!user || !postBoost || !campaignId) { | |
return; | |
} | |
openModal({ | |
type: LazyModal.FetchBoostedPostView, | |
props: { | |
campaignId: campaignId as string, |
Comment bugbot run
to trigger another review on this PR
Was this report helpful? Give feedback by reacting with 👍 or 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joh more and more listeners bloating :(
Yeah, not really liking where this is going. Thankfully, we have plans to build a dedicated page for campaigns. Soon we will replace this. |
Changes
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Jira ticket
MI-888
Preview domain
https://mi-888-notification.preview.app.daily.dev