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

Re-toots not rendered correctly? #2

Open
rschmunk opened this issue May 9, 2024 · 1 comment
Open

Re-toots not rendered correctly? #2

rschmunk opened this issue May 9, 2024 · 1 comment

Comments

@rschmunk
Copy link

rschmunk commented May 9, 2024

I deployed this widget to a website recently, and just discovered that a re-toot post (i.e., a boost) does not render in the widget correctly. The widget does seem to notice the re-toot exits, but it does not show any of its text, or any of its graphic if there are such. A click on the timestamp in the corner of the layout does not lead to the instance server but instead shows what looks like JSON metadata for the re-toot.

Edit: The JSON exposed by clicking the timestamp is on the host instance.

@rschmunk
Copy link
Author

rschmunk commented May 31, 2024

I've spent some time on this and have a partial fix in my copy of the code. The problem is that when the JS code cycles through the array of toots/posts to include in the widget, the appendStatus method simply appends the content text of a post status to the output. For a boost/re-toot, the status.content will be the empty string and the code then needs to check whether the status.reblog field has been set. If so, the value of reblog is the status that should be displayed.

What took me extra work on this was that I wanted the widget to make it evident that there is a boost in play, and the boosted post status is shown indented. (A bit like how one of the Mastodon apps on my phone displays boosts.) It works, but my code is currently a bit messy, and I made a couple non-optimal tweaks to the CSS file. I also need to take a second and third look at how any images in a boost are shown.

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

No branches or pull requests

1 participant