Skip to content
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

site: do not get icon repeatedly #2163

Merged
merged 1 commit into from Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/webserver/site/src/html/bodybuilder.tmpl
Expand Up @@ -104,7 +104,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=eGfPLtv5"></script>
<script src="/js/entry.js?v=qAsSUzx7"></script>
</body>
</html>
{{end}}
2 changes: 1 addition & 1 deletion client/webserver/site/src/js/wallets.ts
Expand Up @@ -603,7 +603,7 @@ export default class WalletsPage extends BasePage {
const { bttn, tmpl } = this.assetButtons[assetID]
Doc.hide(tmpl.fiat, tmpl.noWallet)
bttn.classList.add('nowallet')
tmpl.img.src = Doc.logoPath(a.symbol)
tmpl.img.src ||= Doc.logoPath(a.symbol) // don't initiate GET if already set (e.g. update on some notification)
Copy link
Member Author

@chappjc chappjc Feb 24, 2023

Choose a reason for hiding this comment

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

I first did this with the nullish coalescing assignment operator (??=) but to my surprise the src attribute is never null for an img tag, even if it's not there in the html (as with our template); it's just empty, so we have to go with the falsy condition.

tmpl.name.textContent = a.name
if (a.wallet) {
bttn.classList.remove('nowallet')
Expand Down