MESSENGER-2762 Initial Merge

This commit is contained in:
Frank Rotermund
2022-03-17 15:51:23 +01:00
parent ecae8d618f
commit c2108a2178
384 changed files with 17708 additions and 1928 deletions
@@ -1,5 +1,6 @@
/*
Copyright 2020 New Vector Ltd
Copyright (c) 2021 BWI GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -46,8 +47,20 @@ final class SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphr
self.secretsRecoveryWithPassphraseViewModel.coordinatorDelegate = self
}
func toPresentable() -> UIViewController {
return self.secretsRecoveryWithPassphraseViewController
let controller = self.secretsRecoveryWithPassphraseViewController
// If the flow is not cancellable, run it fullscreen
if let session = AppDelegate.theDelegate().mxSessions.first as? MXSession {
if session.homeserverWellknown.backupRequired() {
if #available(iOS 13.0, *) {
controller.modalPresentationStyle = .fullScreen
}
}
}
return controller
}
}
@@ -1,5 +1,6 @@
/*
Copyright 2020 New Vector Ltd
Copyright (c) 2021 BWI GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -86,10 +87,14 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
// MARK: - Private
private func setupViews() {
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
self?.viewModel.process(viewAction: .cancel)
if let session = AppDelegate.theDelegate().mxSessions.first as? MXSession {
if !session.homeserverWellknown.backupRequired() {
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
self?.viewModel.process(viewAction: .cancel)
}
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
}
}
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
self.title = VectorL10n.secretsRecoveryWithPassphraseTitle
@@ -161,15 +166,15 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart2)
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart3)
self.useRecoveryKeyButton.setAttributedTitle(useRecoveryKeyAttributedString, for: .normal)
if BuildSettings.showRecoverWithKey == true {
self.useRecoveryKeyButton.setAttributedTitle(useRecoveryKeyAttributedString, for: .normal)
} else {
self.useRecoveryKeyButton?.visiblity(gone: true, dimension: 0.0)
}
// Reset secrets button
let resetSecretsAttributedString = NSMutableAttributedString(string: VectorL10n.secretsRecoveryResetActionPart1, attributes: [.foregroundColor: self.theme.textPrimaryColor])
let resetSecretsAttributedStringPart2 = NSAttributedString(string: VectorL10n.secretsRecoveryResetActionPart2, attributes: [.foregroundColor: self.theme.warningColor])
resetSecretsAttributedString.append(resetSecretsAttributedStringPart2)
let resetSecretsAttributedString = NSMutableAttributedString(string: VectorL10n.secretsRecoveryResetActionPart1, attributes: [.foregroundColor: self.theme.tintColor])
self.resetSecretsButton.setAttributedTitle(resetSecretsAttributedString, for: .normal)
}