diff --git a/NucleicRemote/NucleicRemote/Views/SettingsView.swift b/NucleicRemote/NucleicRemote/Views/SettingsView.swift index c7ffbda..158a3ac 100644 --- a/NucleicRemote/NucleicRemote/Views/SettingsView.swift +++ b/NucleicRemote/NucleicRemote/Views/SettingsView.swift @@ -412,6 +412,22 @@ struct AddDeviceView: View { .toolbar { ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } } } + // A Mac joining via this code needs the user's OK — the accepting Mac forwarded its + // confirm here so it can be approved from the phone (an iPhone/iPad joins hands-free). + .confirmationDialog( + "Let “\(store.pendingMacPairRequest?.label ?? "another Mac")” join?", + isPresented: Binding( + get: { store.pendingMacPairRequest != nil }, + set: { if !$0 { store.respondMacPair(false) } }), + titleVisibility: .visible + ) { + Button("Allow") { store.respondMacPair(true) } + Button("Don't allow", role: .destructive) { store.respondMacPair(false) } + Button("Cancel", role: .cancel) { store.respondMacPair(false) } + } message: { + Text("It joins the whole group — it gets the same control of your Macs' sessions an " + + "iPhone does, and every Mac here stays connected.") + } } // Fire the request as the sheet appears; `onDismiss` (on the presenter) tells the Mac to // close its pairing window.