Skip to content

Commit

Permalink
Add current Wi-Fi without auto-trusting
Browse files Browse the repository at this point in the history
  • Loading branch information
keeshux committed Oct 28, 2018
1 parent ebe8c58 commit 474105d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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).

## Unreleased

### Changed

- Add current Wi-Fi to trusted networks list but don't trust it by default.

## 1.0 beta 1159 (2018-10-27)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Passepartout/Resources/en.lproj/Localizable.strings
Expand Up @@ -98,7 +98,7 @@
//"service.cells.vpn_prefers_udp.caption" = "Prefer UDP socket";
"service.cells.trusted_mobile.caption" = "Cellular network";
"service.cells.trusted_wifi.caption" = "%@";
"service.cells.trusted_add_wifi.caption" = "Trust current Wi-Fi";
"service.cells.trusted_add_wifi.caption" = "Add current Wi-Fi";
"service.cells.trusted_policy.caption" = "Retain existing connection";
"service.cells.test_connectivity.caption" = "Test connectivity";
"service.cells.data_count.caption" = "Exchanged bytes count";
Expand Down
5 changes: 3 additions & 2 deletions Passepartout/Sources/Model/TrustedNetworks.swift
Expand Up @@ -129,9 +129,10 @@ class TrustedNetworksModel {
return
}

let isTrusted = false
let rowIndex = rowIndexForWifi(at: index)
let completionHandler: () -> Void = {
self.trustedWifis[wifiToAdd] = true
self.trustedWifis[wifiToAdd] = isTrusted

if !isDuplicate {
self.sortedWifis.insert(wifiToAdd, at: index)
Expand All @@ -140,7 +141,7 @@ class TrustedNetworksModel {
#endif
self.delegate?.trustedNetworks(self, shouldInsertWifiAt: rowIndex)
} else {
self.delegate?.trustedNetworks(self, shouldReloadWifiAt: rowIndex, isTrusted: true)
self.delegate?.trustedNetworks(self, shouldReloadWifiAt: rowIndex, isTrusted: isTrusted)
}

self.delegate?.trustedNetworksShouldReinstall(self)
Expand Down
2 changes: 1 addition & 1 deletion Passepartout/Sources/SwiftGen+Strings.swift
Expand Up @@ -624,7 +624,7 @@ internal enum L10n {
}

internal enum TrustedAddWifi {
/// Trust current Wi-Fi
/// Add current Wi-Fi
internal static let caption = L10n.tr("Localizable", "service.cells.trusted_add_wifi.caption")
}

Expand Down

0 comments on commit 474105d

Please sign in to comment.