-
Notifications
You must be signed in to change notification settings - Fork 2.7k
PLT-7853 Added thumbnail for SVG attachments #176
Conversation
components/file_attachment.jsx
Outdated
@@ -49,6 +49,8 @@ export default class FileAttachment extends React.Component { | |||
const thumbnailUrl = getFileThumbnailUrl(fileInfo.id); | |||
|
|||
Utils.loadImage(thumbnailUrl, this.handleImageLoaded); | |||
} else if (fileInfo.extesnion === 'svg') { |
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.
maybe a type on extesnion
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.
+1 to fix the typo 😄
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.
Good catch. That also meant the loading logic was broken since it should've been showing the loading indicator forever because of that typo
I swear I made a commit that did exactly this a while ago... Edit: I guess that was just for "previews" (mattermost/mattermost#7348). These should probably be made to share code. |
@ccbrown I've meant to combine the logic of those two since I wrote the current version of the file attachments. The |
I'll merge this PR shortly, but I'm using it to test some changes to Mattermod quickly |
* PLT-7853 Added thumbnail for SVG attachments * Fixed loading of SVG attachment thumbnail Moved create_post.jsx to folder and added redux-connect.
* PLT-7853 Added thumbnail for SVG attachments * Fixed loading of SVG attachment thumbnail
…ors (#176) * Complete direct channels info in selectors * better error handling for joinChannel and createDirectChannel * error handling for deleteChannel * Fix unit tests
…ors (#176) * Complete direct channels info in selectors * better error handling for joinChannel and createDirectChannel * error handling for deleteChannel * Fix unit tests
It just uses the raw SVG file since that's probably smaller than loading a rasterized thumbnail image
Ticket Link
https://mattermost.atlassian.net/browse/PLT-7853
Checklist