Release v0.4.1

Auto-search after QR scan in search bar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
woikos
2026-01-05 20:38:28 +01:00
parent 8a9795a53a
commit 08f75a902d
23 changed files with 572 additions and 78 deletions

View File

@@ -342,6 +342,27 @@ const SearchBar = forwardRef<
onKeyDown={handleKeyDown}
onFocus={() => setSearching(true)}
onBlur={() => setSearching(false)}
onQrScan={(value) => {
setInput(value)
// Automatically search after scanning
let id = value
if (id.startsWith('nostr:')) {
id = id.slice(6)
}
try {
const { type } = nip19.decode(id)
if (['nprofile', 'npub'].includes(type)) {
updateSearch({ type: 'profile', search: id })
return
}
if (['nevent', 'naddr', 'note'].includes(type)) {
updateSearch({ type: 'note', search: id })
return
}
} catch {
// Not a valid nip19 identifier, just set input
}
}}
/>
</div>
)