Settings Feature Enhancement
Nucleic-Session: 89BFAB13-D559-43FC-BE28-0B2639BECF0F Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -807,13 +807,25 @@ final class RemoteStore: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The user dismissed the "add a device" sheet — tell the minting Mac to close its pairing
|
/// The user dismissed the "add a device" sheet — tell the minting Mac to close its pairing
|
||||||
/// window (retire the one-time secret) and reset to idle.
|
/// window (retire the one-time secret) and reset to idle. Any Mac-join awaiting approval is
|
||||||
|
/// abandoned here too; the host fails it closed when its pairing window shuts.
|
||||||
func cancelPairingCode() {
|
func cancelPairingCode() {
|
||||||
if !demoMode, let id = pairingMintHostID { connections[id]?.send(.cancelPairingCode) }
|
if !demoMode, let id = pairingMintHostID { connections[id]?.send(.cancelPairingCode) }
|
||||||
pairingMintHostID = nil
|
pairingMintHostID = nil
|
||||||
|
pendingMacPairRequest = nil
|
||||||
|
pendingMacPairHostID = nil
|
||||||
addDevice = .idle
|
addDevice = .idle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Approve or deny a Mac joining via a code this phone shared (the forwarded confirm). Routes
|
||||||
|
/// the answer to the Mac that forwarded it and clears the prompt optimistically.
|
||||||
|
func respondMacPair(_ approve: Bool) {
|
||||||
|
guard let req = pendingMacPairRequest else { return }
|
||||||
|
if let id = pendingMacPairHostID { connections[id]?.send(.respondMacPair(req.deviceID, approve)) }
|
||||||
|
pendingMacPairRequest = nil
|
||||||
|
pendingMacPairHostID = nil
|
||||||
|
}
|
||||||
|
|
||||||
/// A stand-in join code for the offline demo so the QR/copy sheet renders without a Mac.
|
/// A stand-in join code for the offline demo so the QR/copy sheet renders without a Mac.
|
||||||
private static let demoPairingCode = "nucleic://pair?d=demo"
|
private static let demoPairingCode = "nucleic://pair?d=demo"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user