Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #463: Fixes resolution issue in the favorites view #611

Merged
merged 2 commits into from
Mar 4, 2019

Conversation

danielbogomazov
Copy link
Contributor

Pull Request Checklist

  • My patch has gone through review and I have addressed review comments

  • My patch has a standard commit message that looks like Fix #123: This fixes the shattered coffee cup!

  • I have updated the Unit Tests to cover new or changed functionality

  • I have updated the UI Tests to cover new or changed functionality

  • I have marked the bug with [needsuplift]

  • I have made sure that localizable strings use NSLocalizableString()

Screenshots

Notes for testing this patch

Fixes issue 463

The issue stems from passing in a non-nil icon value into the setIcon function which uses that image as an upscale instead of using the FaviconFetcher.

@@ -67,9 +67,10 @@ class FavoritesDataSource: NSObject, UICollectionViewDataSource {
guard let fav = frc?.object(at: indexPath) else { return UICollectionViewCell() }

cell.textLabel.text = fav.displayTitle ?? fav.url
cell.imageView.setIcon(fav.domain?.favicon, forURL: URL(string: fav.url ?? ""), scaledDefaultIconSize: CGSize(width: 40, height: 40), completed: { (color, url) in
let n: FaviconMO? = nil // Distinguishes which setIcon function is called
Copy link
Contributor

Choose a reason for hiding this comment

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

This is kind of an interesting workaround, however, there should be a more determined solution than using a typed optional set to nil to choose the function. One option would be to give the setIcon function different declarations/names, to avoid overloading and calling the wrong function.

@danielbogomazov
Copy link
Contributor Author

The function names have been changed to help distinguish them. Let me know if there's anything else to fix :)

@jhreis jhreis merged commit 1368a45 into brave:development Mar 4, 2019
@jhreis
Copy link
Contributor

jhreis commented Mar 4, 2019

Thanks bunches! Really appreciate the work on this, and thanks for your huge patience with us 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Favourites show low resolution icons for some sites
2 participants