-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: look for image on url head before rendering preview #6127
base: develop
Are you sure you want to change the base?
Conversation
app/containers/message/Urls.tsx
Outdated
@@ -133,7 +133,7 @@ const Url = ({ url }: { url: IUrl }) => { | |||
const getImageUrl = () => { | |||
const imageUrl = url.image || url.url; | |||
|
|||
if (!imageUrl) return null; | |||
if (!imageUrl || imageUrl.includes('.pdf')) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the pdf doesn't include a .pdf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some changes to check if it's image instead of checking if it's not pdf. LGTM, but please review it 🙏🏼
Looks good to me, much simpler! |
Proposed changes
The app crashes on iOS when a PDF link is sent, as it attempts to render an image preview of the link. To fix this, I added a new rule to getImageUrl to prevent rendering when the link points to a PDF.
Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-776
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments