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:
@@ -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>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user