Skip to content

Commit

Permalink
fix private key condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
AsaiToshiya authored and fiatjaf committed Oct 7, 2024
1 parent d9006ba commit 8c50fc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function Editor({
} else {
// otherwise use a key from localStorage or generate a new one
let privateKey = localStorage.getItem('nostrkey')
if (!privateKey || privateKey.match(/^[a-f0-9]{64}$/)) {
if (!privateKey || !privateKey.match(/^[a-f0-9]{64}$/)) {
privateKey = generateSecretKey()
localStorage.setItem('nostrkey', bytesToHex(privateKey))
} else {
Expand Down

0 comments on commit 8c50fc6

Please sign in to comment.