Skip to content
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

Fix the notification URL to chat posts #218

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

tibetsprague
Copy link
Collaborator

Clean up notification post URLs a lot. Move all of it to Frontend.Route.post

Note, these URLs will have to be updated on mobile

Clean up notification post URLs a lot
@@ -434,7 +427,7 @@ module.exports = bookshelf.Model.extend({
post_title: decode(post.title() || ''),
post_topic: firstTag,
post_type: post.get('type'),
post_url: Frontend.Route.tokenLogin(reader, token, this.postUrlHelper({ post, isPublic: false, topic: firstTag, group }) + '?ctt=post_email&cti=' + reader.id),
post_url: Frontend.Route.tokenLogin(reader, token, Frontend.Route.post(post, group, 'ctt=post_email&cti=' + reader.id)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this fixes #183 ?

Copy link
Collaborator Author

@tibetsprague tibetsprague Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, i doubt it, that sounds like a front end issue. but its not happening for me on dev

const tags = post.relations.tags
const firstTopic = tags && tags.first()?.get('name')
if (firstTopic && (post.get('type') === Post.Type.CHAT || group.hasChatFor(firstTopic))) {
return url(`/groups/${groupSlug}/chat/${firstTopic}?postId=${post.id}&${extraParams}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the main update needed for mobile that it needs to track /chat/ related urls?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have that in a current branch

@tibetsprague
Copy link
Collaborator Author

we need this on staging so im going to merge now

@tibetsprague tibetsprague merged commit d14a199 into dev Feb 6, 2025
1 of 2 checks passed
@tibetsprague tibetsprague deleted the cleanup-notification-post-urls branch February 6, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants