From e21b9895a7c93f62565ffa2cd1d6c085b9b74035 Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Sat, 31 Aug 2024 19:54:43 +0200 Subject: [PATCH] Improved input validation, added tests --- src/lib/locales/en.json | 6 ++- src/routes/+page.svelte | 2 +- src/routes/Settings.svelte | 93 ++++++++++++++++++++++++++++++++------ tests/test.ts | 35 ++++++++++++++ 4 files changed, 120 insertions(+), 16 deletions(-) diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index 1e2b3a0..ab664f9 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -42,9 +42,11 @@ "nostrRelay": "Nostr Relay", "nostrZapNotify": "Nostr Zap Notifications", "useNostr": "Use Nostr datasource", - "bitaxeHostname": "BitAxe hostname", + "bitaxeHostname": "BitAxe hostname or IP", "bitaxeEnabled": "Enable BitAxe", - "nostrZapPubkey": "Nostr Zap pubkey" + "nostrZapPubkey": "Nostr Zap pubkey", + "invalidNostrPubkey": "Invalid Nostr pubkey, note that your pubkey does NOT start with npub.", + "convertingValidNpub": "Converting valid npub to pubkey" }, "control": { "systemInfo": "System info", diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index dec2eb5..f2d0b27 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -133,7 +133,7 @@
(toastIsOpen = false)} > diff --git a/src/routes/Settings.svelte b/src/routes/Settings.svelte index 8413936..ab7430d 100644 --- a/src/routes/Settings.svelte +++ b/src/routes/Settings.svelte @@ -1,5 +1,5 @@