diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-05-22 11:04:12 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-05-22 11:35:39 +0200 |
| commit | 6b034b8bd5a4a3118f1c5b06b53169b6b1e4eb2d (patch) | |
| tree | 8fd57b2688d1be156b8ad1546137d7f33d3df196 | |
| parent | ac04af47b5a2a3fc04dde094271ab84d30c0d9fe (diff) | |
| download | mullvadvpn-6b034b8bd5a4a3118f1c5b06b53169b6b1e4eb2d.tar.xz mullvadvpn-6b034b8bd5a4a3118f1c5b06b53169b6b1e4eb2d.zip | |
Disable the settings button on successful login
| -rw-r--r-- | ios/MullvadVPN/Base.lproj/Main.storyboard | 8 | ||||
| -rw-r--r-- | ios/MullvadVPN/LoginViewController.swift | 17 |
2 files changed, 18 insertions, 7 deletions
diff --git a/ios/MullvadVPN/Base.lproj/Main.storyboard b/ios/MullvadVPN/Base.lproj/Main.storyboard index 4c8a189aa3..8402640d4a 100644 --- a/ios/MullvadVPN/Base.lproj/Main.storyboard +++ b/ios/MullvadVPN/Base.lproj/Main.storyboard @@ -212,7 +212,7 @@ </connections> </containerView> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="MapBackground" translatesAutoresizingMaskIntoConstraints="NO" id="3Ck-JT-ogd"> - <rect key="frame" x="0.0" y="94" width="375" height="573.00000000000023"/> + <rect key="frame" x="0.0" y="94" width="375" height="573"/> </imageView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="shY-Lj-oYx"> <rect key="frame" x="24" y="533" width="327" height="110"/> @@ -391,17 +391,17 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LogoIcon" translatesAutoresizingMaskIntoConstraints="NO" id="cKg-hE-JsS"> - <rect key="frame" x="11" y="12" width="49.000000000000014" height="50"/> + <rect key="frame" x="11" y="29" width="16" height="16"/> </imageView> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uXv-Tf-PET"> - <rect key="frame" x="335" y="25" width="24" height="24"/> + <rect key="frame" x="343" y="26" width="16" height="22"/> <state key="normal" image="IconSettings"/> <connections> <action selector="handleSettingsButton" destination="rCI-6x-aLd" eventType="touchUpInside" id="TaM-cZ-TvJ"/> </connections> </button> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MULLVAD VPN" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dqy-A0-TdV"> - <rect key="frame" x="68" y="22" width="168" height="30"/> + <rect key="frame" x="35" y="22" width="168" height="30"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="24"/> <color key="textColor" white="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <nil key="highlightedColor"/> diff --git a/ios/MullvadVPN/LoginViewController.swift b/ios/MullvadVPN/LoginViewController.swift index 7b41482317..b0285caefd 100644 --- a/ios/MullvadVPN/LoginViewController.swift +++ b/ios/MullvadVPN/LoginViewController.swift @@ -183,12 +183,23 @@ class LoginViewController: UIViewController, HeaderBarViewControllerDelegate, UI private func loginStateDidChange() { accountInputGroup.loginState = loginState - if case .authenticating = loginState { + // Keep the settings button disabled to prevent user from going to settings while + // authentication or during the delay after the successful login and transition to the main + // controller. + switch loginState { + case .authenticating: activityIndicator.isAnimating = true + + // Fallthrough to make sure that the settings button is disabled + // in .authenticating and .success cases. + fallthrough + + case .success: headerBarController?.settingsButton.isEnabled = false - } else { - activityIndicator.isAnimating = false + + default: headerBarController?.settingsButton.isEnabled = true + activityIndicator.isAnimating = false } updateDisplayedMessage() |
