mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
Fix Manu's remarks
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ final class SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphr
|
||||
|
||||
// MARK: - SecretsRecoveryWithPassphraseViewModelCoordinatorDelegate
|
||||
extension SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphraseViewModelCoordinatorDelegate {
|
||||
func secretsRecoveryWithPassphraseViewModelDoNotKnowPassphrase(_ viewModel: SecretsRecoveryWithPassphraseViewModelType) {
|
||||
func secretsRecoveryWithPassphraseViewModelWantsToRecoverByKey(_ viewModel: SecretsRecoveryWithPassphraseViewModelType) {
|
||||
self.delegate?.secretsRecoveryWithPassphraseCoordinatorDoNotKnowPassphrase(self)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,6 +19,6 @@ import Foundation
|
||||
/// SecretsRecoveryWithPassphraseViewController view actions exposed to view model
|
||||
enum SecretsRecoveryWithPassphraseViewAction {
|
||||
case recover
|
||||
case unknownPassphrase
|
||||
case useRecoveryKey
|
||||
case cancel
|
||||
}
|
||||
|
||||
+11
-10
@@ -22,10 +22,10 @@
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dlf-fL-IPA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="403"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="421"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gw9-uS-bGl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="403"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="421"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="key_backup_logo" translatesAutoresizingMaskIntoConstraints="NO" id="hA4-wJ-xGz">
|
||||
<rect key="frame" x="163.5" y="35" width="48" height="46"/>
|
||||
@@ -34,14 +34,15 @@
|
||||
<constraint firstAttribute="height" constant="46" id="xDH-Af-ISa"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use your recovery passphrase to unlock your secure message history" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p2V-aL-g0y">
|
||||
<rect key="frame" x="20" y="111" width="335" height="36"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p2V-aL-g0y">
|
||||
<rect key="frame" x="20" y="111" width="335" height="54"/>
|
||||
<string key="text">Access your secure message history and your cross-signing identity for verifying other sessions by entering your recovery passphrase.</string>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uly-5I-NIc">
|
||||
<rect key="frame" x="0.0" y="187" width="375" height="50"/>
|
||||
<rect key="frame" x="0.0" y="205" width="375" height="50"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="enter" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I7Q-Tb-YGd">
|
||||
<rect key="frame" x="20" y="10" width="38" height="30"/>
|
||||
@@ -90,7 +91,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a20-Ii-sAN">
|
||||
<rect key="frame" x="0.0" y="253" width="375" height="50"/>
|
||||
<rect key="frame" x="0.0" y="271" width="375" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="9rW-yL-qS1"/>
|
||||
</constraints>
|
||||
@@ -103,11 +104,11 @@
|
||||
<color key="titleColor" red="0.47843137250000001" green="0.78823529410000004" blue="0.63137254899999995" alpha="0.5" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="unknownPassphraseButtonAction:" destination="KkK-aQ-7Ig" eventType="touchUpInside" id="fXd-03-45l"/>
|
||||
<action selector="useRecoveryKeyButtonAction:" destination="KkK-aQ-7Ig" eventType="touchUpInside" id="fXd-03-45l"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zOv-dc-49b">
|
||||
<rect key="frame" x="0.0" y="333" width="375" height="50"/>
|
||||
<rect key="frame" x="0.0" y="351" width="375" height="50"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DpI-8g-yKB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
|
||||
@@ -116,7 +117,7 @@
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<inset key="contentEdgeInsets" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
|
||||
<state key="normal" title="Unlock History">
|
||||
<state key="normal" title="Recover Secrets">
|
||||
<color key="titleColor" red="0.47843137250000001" green="0.78823529410000004" blue="0.63137254899999995" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<state key="disabled">
|
||||
@@ -195,7 +196,7 @@
|
||||
<outlet property="recoverButtonBackgroundView" destination="zOv-dc-49b" id="QKD-5b-NJT"/>
|
||||
<outlet property="scrollView" destination="FYl-Bb-Kpe" id="jR3-VH-AdU"/>
|
||||
<outlet property="shieldImageView" destination="hA4-wJ-xGz" id="MPg-q1-UVx"/>
|
||||
<outlet property="unknownPassphraseButton" destination="a20-Ii-sAN" id="ZMQ-PQ-jEn"/>
|
||||
<outlet property="useRecoveryKeyButton" destination="a20-Ii-sAN" id="ZMQ-PQ-jEn"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="1uq-Io-hFy" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
+8
-8
@@ -34,7 +34,7 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
|
||||
|
||||
@IBOutlet private weak var passphraseVisibilityButton: UIButton!
|
||||
|
||||
@IBOutlet private weak var unknownPassphraseButton: UIButton!
|
||||
@IBOutlet private weak var useRecoveryKeyButton: UIButton!
|
||||
|
||||
@IBOutlet private weak var recoverButtonBackgroundView: UIView!
|
||||
@IBOutlet private weak var recoverButton: UIButton!
|
||||
@@ -105,7 +105,7 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
|
||||
self.passphraseTitleLabel.text = VectorL10n.secretsRecoveryWithPassphrasePassphraseTitle
|
||||
self.passphraseTextField.addTarget(self, action: #selector(passphraseTextFieldDidChange(_:)), for: .editingChanged)
|
||||
|
||||
self.unknownPassphraseButton.vc_enableMultiLinesTitle()
|
||||
self.useRecoveryKeyButton.vc_enableMultiLinesTitle()
|
||||
|
||||
self.recoverButton.vc_enableMultiLinesTitle()
|
||||
self.recoverButton.setTitle(VectorL10n.secretsRecoveryWithPassphraseRecoverAction, for: .normal)
|
||||
@@ -137,14 +137,14 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
|
||||
self.recoverButtonBackgroundView.backgroundColor = theme.backgroundColor
|
||||
theme.applyStyle(onButton: self.recoverButton)
|
||||
|
||||
let unknownRecoveryKeyAttributedString = NSMutableAttributedString(string: VectorL10n.secretsRecoveryWithPassphraseLostPassphraseActionPart1, attributes: [.foregroundColor: self.theme.textPrimaryColor])
|
||||
let useRecoveryKeyAttributedString = NSMutableAttributedString(string: VectorL10n.secretsRecoveryWithPassphraseLostPassphraseActionPart1, attributes: [.foregroundColor: self.theme.textPrimaryColor])
|
||||
let unknownRecoveryKeyAttributedStringPart2 = NSAttributedString(string: VectorL10n.secretsRecoveryWithPassphraseLostPassphraseActionPart2, attributes: [.foregroundColor: self.theme.tintColor])
|
||||
let unknownRecoveryKeyAttributedStringPart3 = NSAttributedString(string: VectorL10n.secretsRecoveryWithPassphraseLostPassphraseActionPart3, attributes: [.foregroundColor: self.theme.textPrimaryColor])
|
||||
|
||||
unknownRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart2)
|
||||
unknownRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart3)
|
||||
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart2)
|
||||
useRecoveryKeyAttributedString.append(unknownRecoveryKeyAttributedStringPart3)
|
||||
|
||||
self.unknownPassphraseButton.setAttributedTitle(unknownRecoveryKeyAttributedString, for: .normal)
|
||||
self.useRecoveryKeyButton.setAttributedTitle(useRecoveryKeyAttributedString, for: .normal)
|
||||
}
|
||||
|
||||
private func registerThemeServiceDidChangeThemeNotification() {
|
||||
@@ -211,8 +211,8 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
|
||||
self.viewModel.process(viewAction: .recover)
|
||||
}
|
||||
|
||||
@IBAction private func unknownPassphraseButtonAction(_ sender: Any) {
|
||||
self.viewModel.process(viewAction: .unknownPassphrase)
|
||||
@IBAction private func useRecoveryKeyButtonAction(_ sender: Any) {
|
||||
self.viewModel.process(viewAction: .useRecoveryKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-8
@@ -23,7 +23,6 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
// MARK: Private
|
||||
|
||||
private let recoveryService: MXRecoveryService
|
||||
private var currentHTTPOperation: MXHTTPOperation?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -42,10 +41,6 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
self.recoveryService = recoveryService
|
||||
}
|
||||
|
||||
deinit {
|
||||
self.currentHTTPOperation?.cancel()
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
func process(viewAction: SecretsRecoveryWithPassphraseViewAction) {
|
||||
@@ -54,8 +49,8 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
self.recoverWithPassphrase()
|
||||
case .cancel:
|
||||
self.coordinatorDelegate?.secretsRecoveryWithPassphraseViewModelDidCancel(self)
|
||||
case .unknownPassphrase:
|
||||
self.coordinatorDelegate?.secretsRecoveryWithPassphraseViewModelDoNotKnowPassphrase(self)
|
||||
case .useRecoveryKey:
|
||||
self.coordinatorDelegate?.secretsRecoveryWithPassphraseViewModelWantsToRecoverByKey(self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +71,7 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
self.recoveryService.recoverSecrets(nil, withPrivateKey: privateKey, recoverServices: true, success: { [weak self] recoveryResult in
|
||||
guard let self = self else {
|
||||
return
|
||||
}
|
||||
}
|
||||
self.update(viewState: .loaded)
|
||||
self.coordinatorDelegate?.secretsRecoveryWithPassphraseViewModelDidRecover(self)
|
||||
}, failure: { [weak self] error in
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ protocol SecretsRecoveryWithPassphraseViewModelViewDelegate: class {
|
||||
protocol SecretsRecoveryWithPassphraseViewModelCoordinatorDelegate: class {
|
||||
func secretsRecoveryWithPassphraseViewModelDidRecover(_ viewModel: SecretsRecoveryWithPassphraseViewModelType)
|
||||
func secretsRecoveryWithPassphraseViewModelDidCancel(_ viewModel: SecretsRecoveryWithPassphraseViewModelType)
|
||||
func secretsRecoveryWithPassphraseViewModelDoNotKnowPassphrase(_ viewModel: SecretsRecoveryWithPassphraseViewModelType)
|
||||
func secretsRecoveryWithPassphraseViewModelWantsToRecoverByKey(_ viewModel: SecretsRecoveryWithPassphraseViewModelType)
|
||||
}
|
||||
|
||||
/// Protocol describing the view model used by `SecretsRecoveryWithPassphraseViewController`
|
||||
|
||||
Reference in New Issue
Block a user