Trim whitespace and allow API key to be removed
This commit is contained in:
parent
74b76bed96
commit
28764ba9b3
|
@ -26,7 +26,9 @@ $: apiKey = $apiKeyStorage
|
||||||
class="field has-addons has-addons-right"
|
class="field has-addons has-addons-right"
|
||||||
on:submit|preventDefault={(event) => {
|
on:submit|preventDefault={(event) => {
|
||||||
if (event.target && event.target[0].value) {
|
if (event.target && event.target[0].value) {
|
||||||
apiKeyStorage.set(event.target[0].value)
|
apiKeyStorage.set((event.target[0].value).trim())
|
||||||
|
} else {
|
||||||
|
apiKeyStorage.set('') // remove api key
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue