Skip to content

[FIX] svg render on firefox#9311

Merged
rodrigok merged 5 commits intodevelopfrom
fix-svg-firefox
Jan 3, 2018
Merged

[FIX] svg render on firefox#9311
rodrigok merged 5 commits intodevelopfrom
fix-svg-firefox

Conversation

@karlprieb
Copy link
Copy Markdown
Contributor

@karlprieb karlprieb commented Jan 2, 2018

@RocketChat/core

Closes #7980
Closes #9179

image

@karlprieb karlprieb requested review from ggazzo and rodrigok January 2, 2018 19:59
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9311 January 2, 2018 19:59 Inactive
@rodrigok rodrigok added this to the 0.60.3 milestone Jan 2, 2018
@@ -0,0 +1,11 @@
/* globals isFirefox */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

const baseUrl = isFirefox ? () => window.location.href.replace(window.location.hash, '') : () => ""

Template.icon.helpers({ baseUrl })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ggazzo Why??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So the isFirefox check run only one time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @karlprieb

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The if will run only one time, but replace (much heavy) will continue running every time.

I don't see much performance improvement for such non readable code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That function will run over 50 times on every route change, thats why we shouldn't check if is firefox every time.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9311 January 3, 2018 16:15 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9311 January 3, 2018 16:54 Inactive
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.

Right toolbar not displayed in firefox ESR Sometimes Icons don't render on firefox on ubuntu

4 participants