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

Commit

Permalink
Fix #1359: Update touch key modal to include current url
Browse files Browse the repository at this point in the history
  • Loading branch information
jumde committed Aug 9, 2019
1 parent dccde47 commit 73e1110
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Client/Frontend/Popup/AlertPopupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class AlertPopupView: PopupView {
setDialogColor(color: BraveUX.PopupDialogColorLight)
}

func updateTitle(title: String) {
titleLabel.text = title
}

func updateSubviews() {
titleLabel.adjustsFontSizeToFitWidth = false
messageLabel.adjustsFontSizeToFitWidth = false
Expand Down
4 changes: 3 additions & 1 deletion Client/U2FExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ class U2FExtensions: NSObject {
}

if tab?.id == currentTabId && (fido2Service.keyState == .touchKey || u2fService.keyState == .YKFKeyU2FServiceKeyStateTouchKey) {
let currentURL = self.tab?.url?.host ?? ""
popup.updateTitle(title: Strings.touchKeyTitle + currentURL)
popup.showWithType(showType: .flyUp)
return
}
Expand Down Expand Up @@ -1090,7 +1092,7 @@ extension Strings {
public static let U2FAuthenticationError = NSLocalizedString("U2FAuthenticationError", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Error authenticating your security key", comment: "Error handling U2F authentication.") + tryAgain

//Lightning Modals
public static let touchKeyTitle = NSLocalizedString("touchKeyTitle", bundle: Bundle.shared, value: "Use the security key", comment: "Title for touch key modal.")
public static let touchKeyTitle = NSLocalizedString("touchKeyTitle", bundle: Bundle.shared, value: "Use the security key for ", comment: "Title for touch key modal.")
public static let touchKeyMessage = NSLocalizedString("touchKeyMessage", bundle: Bundle.shared, value: "Insert your security key and touch it.", comment: "Message for touch key modal.")
public static let touchKeyCancel = NSLocalizedString("touchKeyCancel", bundle: Bundle.shared, value: "Cancel", comment: "Text for touch key modal button.")

Expand Down

0 comments on commit 73e1110

Please sign in to comment.