mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-11-06 08:15:35 +00:00
fix(mobile): turning the lock off takes Face ID too
Anyone holding the phone, unlocked, could switch the app lock off from Settings. Off now asks for Face ID or the passcode, as on does.
This commit is contained in:
+8
-7
@@ -630,13 +630,14 @@ function settingsScreen() {
|
||||
class: "row choice",
|
||||
onclick: async () => {
|
||||
// Turning it on proves it works first, so no one locks
|
||||
// themselves out.
|
||||
if (!prefs.lock) {
|
||||
try {
|
||||
await authenticate("Turn on the tty7 lock", { allowDeviceCredential: true });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
// themselves out; turning it off takes the owner too, not
|
||||
// whoever holds the phone.
|
||||
try {
|
||||
await authenticate(prefs.lock ? "Turn off the tty7 lock" : "Turn on the tty7 lock", {
|
||||
allowDeviceCredential: true,
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
setPref("lock", !prefs.lock);
|
||||
draw();
|
||||
|
||||
Reference in New Issue
Block a user