RuleView: Get current SSID if available

This commit is contained in:
Kenta Kubo 2020-12-21 00:40:58 +09:00
parent 99c9d7cbd3
commit d6804bd610
2 changed files with 5 additions and 1 deletions

View file

@ -6,6 +6,8 @@
<array>
<string>dns-settings</string>
</array>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>

View file

@ -60,7 +60,9 @@ extension RuleView: View {
.onDelete { self.rule.ssidMatch.remove(atOffsets: $0) }
.onMove { self.rule.ssidMatch.move(fromOffsets: $0, toOffset: $1) }
Button("Add SSID") {
self.rule.ssidMatch.append("")
NEHotspotNetwork.fetchCurrent { network in
self.rule.ssidMatch.append(network?.ssid ?? "")
}
}
}
}