Skip to content

Commit

Permalink
security: Only show prompt when unlocking
Browse files Browse the repository at this point in the history
Do not show the unlock prompt when the system is already unlocked or
preparing to lock.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Jun 18, 2024
1 parent 33bf2f3 commit 97c4191
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 97c4191

Please sign in to comment.