Skip to content

Commit c679de3

Browse files
vveerrggclaude
andcommitted
fix: refresh profile on lock, reuse tab for footer links
- doLock() re-queries getActiveProfileInfo so the lock screen shows the correct active profile after switching - Lock screen footer links (NostrKey.com, Ts&Cs, Donate) now open in the shared nostrkey-options tab instead of spawning new tabs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 522837b commit c679de3

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/sidepanel.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@
233233
</div>
234234
</div>
235235
<div style="flex-shrink:0;padding:12px 16px;border-top:1px solid #49483e;background:#3e3d32;text-align:center;font-size:0.75rem;">
236-
<a href="https://nostrkey.com" target="_blank" rel="noopener" style="color:#b0b0a8;text-decoration:none;">NostrKey.com</a>
236+
<a id="footer-home-link" href="https://nostrkey.com" style="color:#b0b0a8;text-decoration:none;cursor:pointer;">NostrKey.com</a>
237237
<span style="color:#49483e;margin:0 6px;">|</span>
238-
<a href="https://nostrkey.com/terms.html" target="_blank" rel="noopener" style="color:#b0b0a8;text-decoration:none;">Ts &amp; Cs</a>
238+
<a id="footer-terms-link" href="https://nostrkey.com/terms.html" style="color:#b0b0a8;text-decoration:none;cursor:pointer;">Ts &amp; Cs</a>
239239
<span style="color:#49483e;margin:0 6px;">|</span>
240-
<a href="https://nostrkey.com/support.html#donate" target="_blank" rel="noopener" style="color:#a6e22e;text-decoration:none;">Donate</a>
240+
<a id="footer-donate-link" href="https://nostrkey.com/support.html#donate" style="color:#a6e22e;text-decoration:none;cursor:pointer;">Donate</a>
241241
</div>
242242
</div>
243243

src/sidepanel.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ async function doUnlock() {
711711
async function doLock() {
712712
await api.runtime.sendMessage({ kind: 'lock' });
713713
state.isLocked = true;
714+
// Refresh locked access card with current profile
715+
try {
716+
const info = await api.runtime.sendMessage({ kind: 'getActiveProfileInfo' });
717+
if (info && typeof info === 'object') {
718+
state.lockedProfileName = info.name || 'Unnamed Profile';
719+
state.lockedProfileNpub = info.npub || '';
720+
state.lockedProfileHasKeys = !!info.hasKeys;
721+
}
722+
} catch (_) {}
714723
render();
715724
}
716725

@@ -980,6 +989,17 @@ function bindEvents() {
980989
await doUnlock();
981990
});
982991

992+
// Lock screen footer links — reuse same tab
993+
['footer-home-link', 'footer-terms-link', 'footer-donate-link'].forEach(id => {
994+
const el = $(id);
995+
if (el) {
996+
el.addEventListener('click', (e) => {
997+
e.preventDefault();
998+
window.open(el.href, 'nostrkey-options');
999+
});
1000+
}
1001+
});
1002+
9831003
// Reset flow handlers
9841004
if (elements.forgotPasswordBtn) {
9851005
elements.forgotPasswordBtn.addEventListener('click', () => {

0 commit comments

Comments
 (0)