-
Notifications
You must be signed in to change notification settings - Fork 360
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
Added logic to use an internal SpamToken image to TokenImageFetcherImpl instead of fetching it over the network #6657
Conversation
@eviltofu I just realized that we can't remove the spam token icon files from the |
So I schedule a task to remove the spam token icons files 1 month later? Also, this process of adding to the |
Yes, but can you do it this way: Set up a new test class that does this:
Thought I wrote about this approach in the Android repo for some other issue, but I forgot where |
Improving the process is good.
It wouldn't be because it's the same icon file contents (and it's still in git any way) |
@oa-s still reviewing? |
@@ -130,6 +136,10 @@ public class TokenImageFetcherImpl: TokenImageFetcher { | |||
blockChainNameColor: UIColor, | |||
serverIconImage: UIImage?) -> TokenImage? { | |||
|
|||
if tokenGroupsIdentifier.isSpam(address: contractAddress.eip55String, chainID: server.chainID) { | |||
return .init(image: .image(.loaded(image: spamImage)), isFinal: true, overlayServerIcon: nil) |
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.
Didn't test. But I think overlayServerIcon:
still has to be either nil
or not-nil
using the switch-case
a few lines later. That's how the current hardcoded spam (or any token image) loaded from the iconassets
repo are displayed, right?
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.
Updated. Please check @hboon
60dbf29
to
f8235ff
Compare
} | ||
} | ||
|
||
if tokenGroupsIdentifier.isSpam(address: contractAddress.eip55String, chainID: server.chainID) { |
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.
Seems like this will never be true because it was checked in the switch
within the iconIamgeForContractAndhainID(image:address:chain:)
call, so the if
-block can be removed.
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.
Removed.
…pl instead of fetching it over the network
f8235ff
to
98ba1fe
Compare
Closes #6446