From bbc13279e72ba6644dccecc59e03acc8943d769e Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 30 Sep 2026 01:55:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(settings):=20drop=20'Paired=20with=20?= =?UTF-8?q?=E2=80=A6'=20once=20that=20phone=20is=20unpaired?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unpairing the phone just paired left 'Paired with probe.' above an empty 'No phones paired yet.' --- src/ui/settings/mobile.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ui/settings/mobile.rs b/src/ui/settings/mobile.rs index e9d1a8e2..9e030a46 100644 --- a/src/ui/settings/mobile.rs +++ b/src/ui/settings/mobile.rs @@ -320,7 +320,17 @@ impl Tty7App { let pairing = self .active_settings() .and_then(|s| s.mobile_pairing.as_ref()); - let paired = self.active_settings().and_then(|s| s.mobile_paired.clone()); + // Only while that phone is still on the list: unpairing it left + // "Paired with probe." above an empty "No phones paired yet." + let paired = self + .active_settings() + .and_then(|s| s.mobile_paired.clone()) + .filter(|name| { + state + .as_ref() + .and_then(|state| state.devices().ok()) + .is_some_and(|devices| devices.iter().any(|d| &d.name == name)) + }); // A spent code carries its own "New code" beside the reason it is // spent; a second one up here would be the same button twice. let pair_button = if pairing.is_some_and(|p| p.spent.is_some()) {