diff --git a/extension/src/popup/components/settings.ts b/extension/src/popup/components/settings.ts index ad67579..c3c74c5 100644 --- a/extension/src/popup/components/settings.ts +++ b/extension/src/popup/components/settings.ts @@ -31,6 +31,7 @@ const NAV_ITEMS: Array<{ id: SettingsSection; icon: string; label: string; group let activeSection: SettingsSection = 'autofill'; let activeKeyHandler: ((e: KeyboardEvent) => void) | null = null; let pendingVaultSettings: VaultSettings | null = null; +let sessionHandle: number | null = null; export async function renderSettings(container: HTMLElement): Promise { container.innerHTML = ` @@ -45,6 +46,9 @@ export async function renderSettings(container: HTMLElement): Promise { `; + const unlockedResp = await sendMessage({ type: 'is_unlocked' }); + sessionHandle = (unlockedResp.ok && unlockedResp.data && (unlockedResp.data as { unlocked: boolean }).unlocked) ? 1 : null; + wireNav(); await renderSection(activeSection); } @@ -57,6 +61,7 @@ export function teardownSettings(): void { activeKeyHandler = null; } pendingVaultSettings = null; + sessionHandle = null; } function navItemHtml(item: (typeof NAV_ITEMS)[0]): string { @@ -90,7 +95,7 @@ async function renderSection(section: SettingsSection): Promise { switch (section) { case 'autofill': return renderAutofillSection(content); case 'display': return renderDisplaySection(content); - case 'security': return renderSecuritySection(content, null); + case 'security': return renderSecuritySection(content, sessionHandle); case 'generator': return renderGeneratorSection(content); case 'retention': return renderRetentionSection(content); case 'backup': return renderBackupSection(content);