From 661ce2951932b49be9cdaccef8969e8852c946e7 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 30 Sep 2023 11:22:18 +0800 Subject: [PATCH] fix request elevation menu not displayed when reconnect Signed-off-by: 21pages --- flutter/lib/models/model.dart | 1 + src/server/connection.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 02e02a8ba..74d037870 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1660,6 +1660,7 @@ class ElevationModel with ChangeNotifier { bool get showRequestMenu => _canElevate && !_running; onPeerInfo(PeerInfo pi) { _canElevate = pi.platform == kPeerPlatformWindows && pi.sasEnabled == false; + _running = false; } onPortableServiceRunning(Map evt) { diff --git a/src/server/connection.rs b/src/server/connection.rs index 2723b0834..a14fe07e0 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -2379,8 +2379,8 @@ impl Connection { )); if self.authorized { let p = &mut self.portable; - if running != p.last_running { - p.last_running = running; + if Some(running) != p.last_running { + p.last_running = Some(running); let mut misc = Misc::new(); misc.set_portable_service_running(running); let mut msg = Message::new(); @@ -2660,7 +2660,7 @@ pub enum FileAuditType { pub struct PortableState { pub last_uac: bool, pub last_foreground_window_elevated: bool, - pub last_running: bool, + pub last_running: Option, pub is_installed: bool, }