diff --git a/TalerWallet1/Views/Sheets/QRSheet.swift b/TalerWallet1/Views/Sheets/QRSheet.swift index 956ecbf0..391ce795 100644 --- a/TalerWallet1/Views/Sheets/QRSheet.swift +++ b/TalerWallet1/Views/Sheets/QRSheet.swift @@ -69,9 +69,22 @@ struct QRSheet: View { scannedCode = result.string closingAnnouncement = String(localized: "QR code recognized", comment: "a11y") case .failure(let error): - // TODO: errorAlert scannedSomething = false - model.setError(error) + // ScanError has no description of its own: shown as it is, the user reads + // "The operation couldn’t be completed. (CodeScanner.ScanError error 3.)" + switch error { + case .permissionDenied: + model.setMessage(String(localized: "No access to the camera"), + String(localized: "To scan a QR code, allow this app to use the camera in the Settings app. You can also paste a payment link instead.")) + case .badInput: + model.setMessage(String(localized: "Camera not available"), + String(localized: "The camera of this device could not be used to scan a QR code.")) + case .badOutput: + model.setMessage(String(localized: "No QR code found"), + String(localized: "No QR code could be read. Please try again.")) + case .initError(let initError): + model.setError(initError) + } closingAnnouncement = errorAnnouncement } announce(closingAnnouncement)