NicolasConstant / sengi

Mastodon & Pleroma Multi-account Desktop Client
https://nicolasconstant.github.io/sengi/
GNU Affero General Public License v3.0
524 stars 34 forks source link

"undefined" being emitted when alt text / image description is empty, instead of omitting the image description #632

Closed jerwarren closed 3 months ago

jerwarren commented 5 months ago

When posting image with Sengi without providing alt text, the string "undefined" is set as alt text instead of omitting the alt text. Seems like it probably just needs to check if there is any alt text rather than just setting its value assuming it has some.

Here's an example: https://mastodon.cloud/@MichaelTheGeek/111723392900915243

I conducted a test with that user after noticing that all their images had "undefined" alt text, and determined it's Sengi causing it. (The same didn't happen when they posted with other clients.)

jerwarren commented 5 months ago

Pretty sure this function here to blame, needing to check for the existence of attachment.description before trying to use it:

image

in media-viewer.component.ts

NicolasConstant commented 3 months ago

will be available next release!