Sessions Integration Feature
Nucleic-Session: FC94353F-9F0D-4BCC-AD7C-0FB14E38C2E5 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -55,9 +55,6 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
Section("Connection") {
|
Section("Connection") {
|
||||||
LabeledContent("Status", value: store.connectivity.label)
|
LabeledContent("Status", value: store.connectivity.label)
|
||||||
if !store.hostName.isEmpty {
|
|
||||||
LabeledContent("Mac", value: store.hostName)
|
|
||||||
}
|
|
||||||
// What this pairing can dial — the live transport is in Status above.
|
// What this pairing can dial — the live transport is in Status above.
|
||||||
if let host = IdentityStore.loadPairedHost() {
|
if let host = IdentityStore.loadPairedHost() {
|
||||||
LabeledContent("Transports", value: Self.transportsLabel(host))
|
LabeledContent("Transports", value: Self.transportsLabel(host))
|
||||||
@@ -66,14 +63,13 @@ struct SettingsView: View {
|
|||||||
.disabled(!store.isPaired)
|
.disabled(!store.isPaired)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mesh P3: every Mac this phone is paired with. Today the connection uses the
|
// Mesh P3: every Mac this phone is paired with — all connected at once and shown
|
||||||
// "Active" one (most-recently paired); the multiplexer will connect to all. Removing
|
// together in the app (no active-host selector). Removing one forgets just that Mac
|
||||||
// the active Mac unpairs the live connection; removing another just forgets it.
|
// and drops its connection; the others keep running.
|
||||||
let pairedHosts = IdentityStore.pairedHosts()
|
let pairedHosts = IdentityStore.pairedHosts()
|
||||||
if !pairedHosts.isEmpty {
|
if !pairedHosts.isEmpty {
|
||||||
Section("Mesh") {
|
Section("Mesh") {
|
||||||
ForEach(pairedHosts, id: \.fingerprint) { host in
|
ForEach(pairedHosts, id: \.fingerprint) { host in
|
||||||
let isActive = host.fingerprint == pairedHosts.last?.fingerprint
|
|
||||||
HStack(spacing: 10) {
|
HStack(spacing: 10) {
|
||||||
Image(systemName: "desktopcomputer").foregroundStyle(.secondary)
|
Image(systemName: "desktopcomputer").foregroundStyle(.secondary)
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
@@ -82,15 +78,8 @@ struct SettingsView: View {
|
|||||||
.font(.footnote.monospaced()).foregroundStyle(.secondary)
|
.font(.footnote.monospaced()).foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
if isActive {
|
|
||||||
Text("Active").font(.caption).foregroundStyle(.secondary)
|
|
||||||
}
|
|
||||||
Button(role: .destructive) {
|
Button(role: .destructive) {
|
||||||
if isActive {
|
store.unpair(host.fingerprint)
|
||||||
store.unpair()
|
|
||||||
} else {
|
|
||||||
IdentityStore.removePairedHost(id: host.fingerprint)
|
|
||||||
}
|
|
||||||
pairedHostsToken = UUID()
|
pairedHostsToken = UUID()
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "minus.circle")
|
Image(systemName: "minus.circle")
|
||||||
|
|||||||
Reference in New Issue
Block a user