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

Commit

Permalink
Fix #1475: Update passcode screen after completion. (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub authored and jhreis committed Sep 4, 2019
1 parent 102fbb8 commit 82b0271
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ private let PaneSwipeDuration: TimeInterval = 0.3

/// Base class for implementing a Passcode configuration screen with multiple 'panes'.
class PagingPasscodeViewController: BasePasscodeViewController {
var completion: (() -> Void)?

fileprivate lazy var pager: UIScrollView = {
let scrollView = UIScrollView()
scrollView.isPagingEnabled = true
Expand Down Expand Up @@ -46,6 +48,7 @@ class PagingPasscodeViewController: BasePasscodeViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.view.endEditing(true)
completion?()
}
}

Expand Down
3 changes: 3 additions & 0 deletions Client/Frontend/Settings/PasscodeSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PasscodeSettingsViewController: TableViewController {
Row(text: Strings.AuthenticationTurnOffPasscode,
selection: { [unowned self] in
let setupPasscodeController = RemovePasscodeViewController()
setupPasscodeController.completion = self.reloadSections
let container = UINavigationController(rootViewController: setupPasscodeController)
self.present(container, animated: true)
},
Expand All @@ -49,6 +50,7 @@ class PasscodeSettingsViewController: TableViewController {
Row(text: Strings.AuthenticationChangePasscode,
selection: { [unowned self] in
let changePasscodeController = ChangePasscodeViewController()
changePasscodeController.completion = self.reloadSections
let container = UINavigationController(rootViewController: changePasscodeController)
self.present(container, animated: true)
}
Expand Down Expand Up @@ -80,6 +82,7 @@ class PasscodeSettingsViewController: TableViewController {
Row(text: Strings.AuthenticationTurnOnPasscode,
selection: { [unowned self] in
let setupPasscodeController = SetupPasscodeViewController()
setupPasscodeController.completion = self.reloadSections
let container = UINavigationController(rootViewController: setupPasscodeController)
self.present(container, animated: true)
},
Expand Down

0 comments on commit 82b0271

Please sign in to comment.