From 771911adf978c52133ce1a344020819228a35a70 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 18 Jun 2024 13:18:31 -0600 Subject: [PATCH] security: Only show prompt when unlocking Do not show the unlock prompt when the system is already unlocked or preparing to lock. Signed-off-by: Tim Crawford --- src/security.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/security.rs b/src/security.rs index 652d522..529878e 100644 --- a/src/security.rs +++ b/src/security.rs @@ -273,13 +273,12 @@ extern "win64" fn run() -> bool { }; debugln!("security state: {:?}", security_state); - if security_state == SecurityState::Lock { - // Already locked, so do not confirm + + // Only show prompt when unlocking + if security_state != SecurityState::PrepareUnlock { return false; } - // Not locked, require confirmation - let res = match Output::one() { Ok(output) => { let mut display = Display::new(output);