Combine key scanning logic in one class

This commit is contained in:
Danny Moesch 2020-08-26 21:29:05 +02:00 committed by Mingshen Sun
parent edd7398cd4
commit 078503f249
10 changed files with 405 additions and 112 deletions

View file

@ -416,11 +416,11 @@ extension PasswordEditorTableViewController: PasswordSettingSliderTableViewCellD
// MARK: - QRScannerControllerDelegate
extension PasswordEditorTableViewController: QRScannerControllerDelegate {
func checkScannedOutput(line: String) -> (accept: Bool, message: String) {
func checkScannedOutput(line: String) -> (accepted: Bool, message: String) {
if let url = URL(string: line), Token(url: url) != nil {
return (accept: true, message: "ValidTokenUrl".localize())
return (true, "ValidTokenUrl".localize())
}
return (accept: false, message: "InvalidTokenUrl".localize())
return (false, "InvalidTokenUrl".localize())
}
func handleScannedOutput(line: String) {