Closed cryptomar1o closed 1 year ago
It's not a bug, it's a feature, implemented in this commit.
const noName = !t.symbol || t.symbol.toLowerCase() === t.name?.toLowerCase()
, i.e. do not show the symbol if it is the same as the name.
Is it confusing? Should I remove the behaviour?
@sime From Slack: "Is it confusing? -> hard to say, there was just one feedback until now from our users…" https://satoshilabs.slack.com/archives/C01SXSHGK44/p1668758402923239
Please decide whether this behaviour should be changed, feel free to close the issue if not.
It's not a bug, it's a feature, implemented in this commit.
const noName = !t.symbol || t.symbol.toLowerCase() === t.name?.toLowerCase()
, i.e. do not show the symbol if it is the same as the name.Is it confusing? Should I remove the behaviour?
@gabrielKerekes @vladimirvolek
This code change has introduced into an ADA related PR. Any hesitations about allowing token name and token symbol to appear side by side if they are the same?
I think that should have been cardano-specific change since we had no reason to change rendering of ethereum tokens => bug :disappointed:
That condition should be evaluated only in cardano right? @vladimirvolek
It was implemented because cardano tokens don’t always have a name/symbol. In such a case we are rendering only token fingerprint (unique identifier) and it didn’t make sense to render it twice as it is quite long (see screenshot, first token doesn’t have any name/symbol, second one does).
Should I open a PR? it should be rather quick fix to run that one line of code only in cardano, reverting rendering of ethereum tokens to the state before the cardano PR.
Thanks @slowbackspace, the condition to not show the symbol (and the dash) is fine for other networks, too, but the second condition (if symbol is the same as name) should be Cardano-specific or omitted entirely. Also, the variable should be called noSymbol
rather than noName
, I believe.
Thanks @slowbackspace, the condition to not show the symbol (and the dash) is fine for other networks, too, but the second condition (if symbol is the same as name) should be Cardano-specific or omitted entirely. Also, the variable should be called
noSymbol
rather thannoName
, I believe.
I agree the naming is confusing. Second condition is needed in cardano because name and symbol fields both fallback to asset fingerprint in case of missing token name/symbol (see example of the asset below) - don't ask why, I can't remember, but it was necessary if we did not want to rewrite half of the token management in suite which is really tailored only for ethereum tokens.
{
"type": "BLOCKFROST",
"name": "asset1cvmyrfrc7lpht2hcjwr9lulzyyjv27uxh3kcz0",
"address": "6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7",
"symbol": "asset1cvmyrfrc7lpht2hcjwr9lulzyyjv27uxh3kcz0",
"balance": "1",
"decimals": 0
}
The condition is a workaround to figure out that the cardano asset doesn't have a name (technically there is no symbol in cardano asset, at least not on chain, only optional name prop. I think that's why we called the variable noName
😅).
Renaming it to noSymbol
and evaluating that 2nd condition only in cardano should solve things, so do you want me to make a PR or will you take care of it?
I am still not sure you need that first part (!t.symbol
), IIRC ethereum tokens without symbol are stripped away during account creation, but let's keep it to not break anything.
@slowbackspace Good, please create a PR and assign me.
QA OK
Info:
Describe the bug For some ERC20 tokens, the symbol is missing before the token names.
Info:
How to reproduce Steps to reproduce the behavior:
Expected behavior The symbol is shown for those tokens before their name as for the other ERC20 tokens
Screenshots