Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class StoriesWebviewViewController: UIViewController,
label.numberOfLines = 1
}

private let shieldImageView: UIImageView = .build { imageView in
imageView.image = UIImage(named: StandardImageIdentifiers.Large.shieldCheckmark)?.withRenderingMode(.alwaysTemplate)
}
private let shieldImageView: UIImageView = .build()

private lazy var reloadToolbarButton: UIBarButtonItem = {
let button = UIBarButtonItem(
Expand Down Expand Up @@ -164,6 +162,10 @@ class StoriesWebviewViewController: UIViewController,
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation?) {
// Update domain label when navigation finishes (in the same window)
domainLabel.text = webView.url?.normalizedHost

shieldImageView.image = webView.hasOnlySecureContent ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Super nit: Could we enhance a bit readability here:

let image = if webView.hasSecureContent {
 UIImage.template
} else {
 UIImage(named: )
}

UIImage.templateImageNamed(StandardImageIdentifiers.Small.shieldCheckmarkFill)
: UIImage(named: StandardImageIdentifiers.Small.shieldSlashFillMulticolor)
}

// MARK: - WKUIDelegate
Expand All @@ -187,6 +189,6 @@ class StoriesWebviewViewController: UIViewController,
let theme = themeManager.getCurrentTheme(for: windowUUID)
applyNavigationBarTheme(theme: theme)
domainLabel.textColor = theme.colors.textPrimary
shieldImageView.tintColor = theme.colors.iconPrimary
shieldImageView.tintColor = theme.colors.iconSecondary
}
}