Display backup import progress

This commit is contained in:
Andy Uhnak
2023-01-30 14:45:07 +00:00
parent 3e880db9e3
commit bcfcd82f57
7 changed files with 45 additions and 14 deletions
@@ -29,6 +29,7 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController {
@IBOutlet private weak var shieldImageView: UIImageView!
@IBOutlet private weak var informationLabel: UILabel!
@IBOutlet private weak var progressLabel: UILabel!
// MARK: Private
@@ -118,8 +119,8 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController {
private func render(viewState: KeyBackupRecoverFromPrivateKeyViewState) {
switch viewState {
case .loading:
self.renderLoading()
case .loading(let progress):
self.renderLoading(progress: progress)
case .loaded:
self.renderLoaded()
case .error(let error):
@@ -127,8 +128,11 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController {
}
}
private func renderLoading() {
private func renderLoading(progress: Double) {
self.activityPresenter.presentActivityIndicator(on: self.view, animated: true)
let percent = Int(round(progress * 100))
self.progressLabel.text = VectorL10n.keyBackupRecoverFromPrivateKeyProgress("\(percent)")
}
private func renderLoaded() {