Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismiss servers list once selection made. #19

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions WireGuard/WireGuard/UI/iOS/Home/Views/VPNToggleView.xib
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VPNToggleView" customModule="WireGuard" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VPNToggleView" customModule="Firefox_Private_Network_VPN" customModuleProvider="target">
<connections>
<outlet property="globeImageView" destination="MYo-vc-qhs" id="HmY-3T-1nv"/>
<outlet property="subtitleLabel" destination="2xu-al-pMZ" id="AbW-Or-LaV"/>
Expand Down Expand Up @@ -42,7 +41,7 @@
<constraint firstAttribute="width" constant="80" id="dgH-Xm-jQM"/>
</constraints>
</imageView>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sYv-xh-0Gx">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="sYv-xh-0Gx">
<rect key="frame" x="150.5" y="240.5" width="51" height="31"/>
</switch>
</subviews>
Expand Down
12 changes: 10 additions & 2 deletions WireGuard/WireGuard/UI/iOS/Navigation/NavigationCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class NavigationCoordinator: Navigating {
init(dependencyProvider: DependencyProviding) {
self.dependencyProvider = dependencyProvider
setupHeartbeat()
setupServerList()
}

var rootViewController: UIViewController {
Expand All @@ -24,12 +25,19 @@ class NavigationCoordinator: Navigating {

private func setupHeartbeat() {
dependencyProvider.accountManager.heartbeatFailedEvent
.subscribe { _ in
self.navigateToLogin()
.subscribe { [weak self] _ in
self?.navigateToLogin()
}.disposed(by: disposeBag)
dependencyProvider.accountManager.startHeartbeat() // TODO: Should this be here?
}

private func setupServerList() {
dependencyProvider.tunnelManager.cityChangedEvent
.subscribe { [weak self] _ in
self?.navigateToHomeVPN()
}.disposed(by: disposeBag)
}

// MARK: <NavigationProtocol>
internal func navigate(after action: NavigationAction) {
switch action {
Expand Down