From a1267bc68ede83e4412e867714f145a987aa8748 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 31 Dec 2020 13:50:51 -0500 Subject: [PATCH] Fix rerendering of React-based icons in HiDPI mode With the variable in the outer scope, "@2x" keeps getting added to the URL. --- chrome/content/zotero/components/icons.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/components/icons.jsx b/chrome/content/zotero/components/icons.jsx index 5a6bc2f31e..77d5eb84e9 100644 --- a/chrome/content/zotero/components/icons.jsx +++ b/chrome/content/zotero/components/icons.jsx @@ -26,12 +26,13 @@ function i(name, svgOrSrc, hasDPI=true) { const { className } = this.props if (typeof svgOrSrc == 'string') { + let finalSrc = svgOrSrc; if (hasDPI && window.devicePixelRatio >= 1.25) { let parts = svgOrSrc.split('.'); parts[parts.length-2] = parts[parts.length-2] + '@2x'; - svgOrSrc = parts.join('.') + finalSrc = parts.join('.') } - return + return } return (