Skip to content

Commit f8ad370

Browse files
Fix: move privkey init after function definition
1 parent 7b6829d commit f8ad370

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

demo.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,6 @@ <h1>📝 Live Notes</h1>
420420
let isNewNote = false;
421421
let privkey = localStorage.getItem('nostr-privkey') || '';
422422

423-
// Initialize privkey input
424-
if (privkey) {
425-
document.getElementById('privkeyInput').value = privkey;
426-
onPrivkeyChange();
427-
}
428-
429423
function renderMarkdown(text) {
430424
return marked.parse(text);
431425
}
@@ -486,6 +480,12 @@ <h1>📝 Live Notes</h1>
486480
}
487481
};
488482

483+
// Initialize privkey input from localStorage
484+
if (privkey) {
485+
document.getElementById('privkeyInput').value = privkey;
486+
window.onPrivkeyChange();
487+
}
488+
489489
async function loadNotes() {
490490
const files = await client.listFiles();
491491
notes = files.filter(f => f.name.endsWith('.md'));

0 commit comments

Comments
 (0)