fix: hide passcode input after successful validation

When a passcode matched, entered_passcode was cleared and the trigger
was set, but show_passcode_input was never set to false. This left the
input visible so users could keep typing after access was granted.

Set show_passcode_input = false immediately after clearing entered_passcode
on a successful match, consistent with the intent described in the
handle_clear_access() function which resets it to true on clear.
This commit is contained in:
Scott Idem
2026-03-16 17:54:52 -04:00
parent 8f88e043b3
commit c9050264a5

View File

@@ -5,15 +5,7 @@
// *** Import other supporting libraries
// import { liveQuery } from "dexie";
import {
ShieldEllipsis,
ShieldMinus,
ShieldPlus,
ShieldUser,
User,
UserCheck
} from '@lucide/svelte';
import { Lock, LockOpen, RefreshCw, ShieldEllipsis, ShieldMinus, ShieldPlus, ShieldUser, Unlink, User, UserCheck, UserRound, Wand2 } from '@lucide/svelte';
// *** Import Aether specific variables and functions
import { ae_util } from '$lib/ae_utils/ae_utils';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
@@ -240,6 +232,7 @@
}
entered_passcode = '';
show_passcode_input = false;
trigger = 'process_permission_check';
$ae_loc.app_cfg.show_element__menu = false;
@@ -359,7 +352,7 @@
class="btn btn-sm preset-tonal-success border border-success-500 hover:preset-filled-success-500 transition-all hover:transition-all *:hover:inline"
title="Syncing the local configuration with the remote configuration."
>
<span class="fas fa-sync m-1"></span>
<RefreshCw size="1em" class="m-1" />
<span class="hidden"> Sync </span>
</button>
{:else}
@@ -379,7 +372,7 @@
class="btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition-all hover:transition-all *:hover:inline"
title="Currently not syncing with the remote server. Re-sync the local configuration with the remote configuration?"
>
<span class="fas fa-unlink m-1"></span>
<Unlink size="1em" class="m-1" />
<span class="hidden"> Re-sync? </span>
</button>
{/if}
@@ -431,12 +424,12 @@
title={show_passcode_input ? 'Cancel passcode entry' : 'Enter a passcode to unlock access'}
>
{#if show_passcode_input}
<span class="fas fa-lock-open mx-1"></span>
<LockOpen size="1em" class="mx-1" />
<span>Cancel</span>
{:else}
<span class="fas fa-lock mx-1"></span>
<Lock size="1em" class="mx-1" />
<span class="lock_icon">Locked</span>
<span class="fas fa-unlock mx-1 unlock_icon hidden"></span>
<LockOpen size="1em" class="mx-1 unlock_icon hidden" />
<span class="unlock_text">Access?</span>
{/if}
</button>
@@ -453,16 +446,16 @@
title={`Current access type/level: ${$ae_loc.access_type}`}
>
{#if $ae_loc.access_type == 'super'}
<span class="fas fa-hat-wizard m-1"></span>
<Wand2 size="1em" class="m-1" />
<span class="hidden">Super</span>
{:else if $ae_loc.access_type == 'manager'}
<span class="fas fa-user-shield m-1"></span>
<ShieldUser size="1em" class="m-1" />
<span class="hidden">Manager</span>
{:else if $ae_loc.access_type == 'administrator'}
<span class="fas fa-user-ninja m-1"></span>
<UserRound size="1em" class="m-1" />
<span class="hidden">Administrator</span>
{:else if $ae_loc.access_type == 'trusted'}
<span class="fas fa-user-check m-1"></span>
<UserCheck size="1em" class="m-1" />
<span class="hidden">Trusted Access</span>
{:else if $ae_loc.access_type == 'public'}
Public
@@ -598,14 +591,6 @@
} */
/* END: Svelte Access Type component */
.access_type_unlock_btn:hover .lock_icon {
display: none;
}
.access_type_unlock_btn:hover .unlock_icon {
display: initial;
}
.access_type_unlock_btn .unlock_text {
display: none;
}