mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 08:19:06 -05:00
do not act on input blank.
This commit is contained in:
parent
c2a826e854
commit
b94219512f
|
@ -85,7 +85,7 @@ object Main extends IOWebApp {
|
|||
cls := "w-full max-h-96 p-3 rounded",
|
||||
styleAttr := "min-height: 280px; font-family: monospace",
|
||||
spellCheck := false,
|
||||
placeholder := "paste something nostric",
|
||||
placeholder := "paste something nostric (event JSON, nprofile, npub, nevent etc or hex key or id)",
|
||||
onInput --> (_.foreach(_ =>
|
||||
self.value.get.flatMap(store.input.set)
|
||||
)),
|
||||
|
|
|
@ -12,7 +12,8 @@ type Result = Either[
|
|||
]
|
||||
|
||||
object Parser {
|
||||
def parseInput(input: String): Result =
|
||||
def parseInput(input: String): Result = if input == "" then Left("")
|
||||
else
|
||||
ByteVector
|
||||
.fromHex(input)
|
||||
.flatMap(b => Try(Right(ByteVector32(b))).toOption)
|
||||
|
|
Loading…
Reference in New Issue
Block a user