Skip to content

Commit

Permalink
support DC_QR_BACKUP2
Browse files Browse the repository at this point in the history
BACKUP2-qr-codes are generated by newer cores,
they of course should also be supported when scanning QR codes.
  • Loading branch information
r10s committed Aug 9, 2024
1 parent 668bd8a commit 7b918bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class WelcomeViewController: UIViewController {
extension WelcomeViewController: QrCodeReaderDelegate {
func handleQrCode(_ code: String) {
let lot = dcContext.checkQR(qrCode: code)
if lot.state == DC_QR_BACKUP {
if lot.state == DC_QR_BACKUP || lot.state == DC_QR_BACKUP2 {
confirmSetupNewDevice(qrCode: code)
} else {
qrErrorAlert()
Expand Down
2 changes: 1 addition & 1 deletion deltachat-ios/Controller/QrPageController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ extension QrPageController: QrCodeReaderDelegate {
}))
present(alert, animated: true, completion: nil)

case DC_QR_BACKUP:
case DC_QR_BACKUP, DC_QR_BACKUP2:
// alert is shown in WelcomeViewController
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
_ = dcAccounts.add()
Expand Down
2 changes: 1 addition & 1 deletion deltachat-ios/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class AppCoordinator: NSObject {

if let accountCode {
let qr = dcAccounts.getSelected().checkQR(qrCode: accountCode)
if qr.state == DC_QR_BACKUP {
if qr.state == DC_QR_BACKUP || qr.state == DC_QR_BACKUP2 {
viewControllers = [WelcomeViewController(dcAccounts: dcAccounts, accountCode: accountCode)]
} else {
viewControllers = [
Expand Down

0 comments on commit 7b918bd

Please sign in to comment.