Skip to content

Commit

Permalink
Prune query params by type
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed May 23, 2024
1 parent 711ed36 commit 0949b08
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 0949b08

Please sign in to comment.