From 4eeca4c63c727c579d8ca43d27787a928d665d9e Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 5 Mar 2019 10:14:21 +0100 Subject: [PATCH] Forgive a nil statusIndexPath Also drop a few unused and potentially dangerous similar methods. Fixes #36 --- CHANGELOG.md | 6 +++++ .../Scenes/ServiceViewController.swift | 24 ++++--------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bbe58e0..034f3414 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.0.3 Beta 1323 (2019-03-06) + +### Fixed + +- Regression in profile activation. [#36](https://github.com/passepartoutvpn/passepartout-ios/issues/36) + ## 1.0.2 (2019-03-04) ### Fixed diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 20f303d6..dc85a884 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -482,18 +482,8 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog return model.index(ofSection: .trusted) } - private var serviceIndexPath: IndexPath { - guard let ip = model.indexPath(row: .vpnService, section: .vpn) else { - fatalError("Could not locate serviceIndexPath") - } - return ip - } - - private var statusIndexPath: IndexPath { - guard let ip = model.indexPath(row: .connectionStatus, section: .vpn) else { - fatalError("Could not locate statusIndexPath") - } - return ip + private var statusIndexPath: IndexPath? { + return model.indexPath(row: .connectionStatus, section: .vpn) } private var endpointIndexPath: IndexPath { @@ -503,13 +493,6 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog return ip } - private var providerPresetIndexPath: IndexPath { - guard let ip = model.indexPath(row: .providerPreset, section: .configuration) else { - fatalError("Could not locate providerPresetIndexPath") - } - return ip - } - func numberOfSections(in tableView: UITableView) -> Int { return model.count } @@ -937,6 +920,9 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog guard service.isActiveProfile(profile) else { return } + guard let statusIndexPath = statusIndexPath else { + return + } tableView.reloadRows(at: [statusIndexPath], with: .none) }