Skip to content

Commit

Permalink
Optimizing the logins list screen (#1982)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1201493110486074/1205258271017091/f
Tech Design URL:
CC:

Description:
Removes unused legacy favicon code that was impacting screen loading times
  • Loading branch information
amddg44 authored Sep 11, 2023
1 parent 0c93248 commit 178157a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions DuckDuckGo/AutofillLoginListItemViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import UIKit
import Common

final class AutofillLoginListItemViewModel: Identifiable, Hashable {
@Published var image = UIImage(systemName: "globe")!

var preferredFaviconLetters: String {
let accountName = self.account.name(tld: tld, autofillDomainNameUrlMatcher: urlMatcher)
Expand All @@ -47,20 +46,6 @@ final class AutofillLoginListItemViewModel: Identifiable, Hashable {
self.title = account.name(tld: tld, autofillDomainNameUrlMatcher: autofillDomainNameUrlMatcher)
self.subtitle = account.username ?? ""
self.urlMatcher = autofillDomainNameUrlMatcher
fetchImage()
}

private func fetchImage() {
FaviconsHelper.loadFaviconSync(forDomain: account.domain,
usingCache: .fireproof,
useFakeFavicon: true,
preferredFakeFaviconLetters: preferredFaviconLetters) { image, _ in
if let image = image {
self.image = image
} else {
self.image = UIImage(systemName: "globe")!
}
}
}

static func == (lhs: AutofillLoginListItemViewModel, rhs: AutofillLoginListItemViewModel) -> Bool {
Expand Down

0 comments on commit 178157a

Please sign in to comment.