Handle name change on onboarding
This commit is contained in:
parent
6659a697de
commit
3c3f67c300
|
@ -31,6 +31,18 @@
|
||||||
return "Invalid URL"
|
return "Invalid URL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: urlManuallySet = false
|
||||||
|
|
||||||
|
const updateUrl = event => {
|
||||||
|
const appName = event.detail
|
||||||
|
if (urlManuallySet) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedUrl = appName.toLowerCase().replace(/\s+/g, "-")
|
||||||
|
url = encodeURI(parsedUrl)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
@ -43,11 +55,13 @@
|
||||||
bind:value={name}
|
bind:value={name}
|
||||||
bind:error={nameError}
|
bind:error={nameError}
|
||||||
validate={validateName}
|
validate={validateName}
|
||||||
|
on:change={updateUrl}
|
||||||
label="Name"
|
label="Name"
|
||||||
/>
|
/>
|
||||||
<FancyInput
|
<FancyInput
|
||||||
bind:value={url}
|
bind:value={url}
|
||||||
bind:error={urlError}
|
bind:error={urlError}
|
||||||
|
on:change={() => (urlManuallySet = true)}
|
||||||
validate={validateUrl}
|
validate={validateUrl}
|
||||||
label="URL"
|
label="URL"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue