From 0949b089caa1bfcbc26cb7372e27085da84933f2 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 23 May 2024 05:51:26 -0500 Subject: [PATCH] Prune query params by type --- components/notifications.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/notifications.js b/components/notifications.js index a9e3e3512..a4f4473bb 100644 --- a/components/notifications.js +++ b/components/notifications.js @@ -144,8 +144,16 @@ const onClickFailedItem = ({ n }) => { if (isPost) { const type = determineItemType(n.item) - const query = { type, title, text, url, bounty, boost, sub } - // TODO: prune query params by type + const query = { type, title, text, sub } + if (boost > 0) { + query.boost = boost + } + if (type === 'link') { + query.url = url + } + if (type === 'bounty' && bounty > 0) { + query.bounty = bounty + } return { href: { pathname: '/post',