show if homeserver URL is invalid
This commit is contained in:
parent
caf5bf154e
commit
59af88a7c7
|
@ -4,6 +4,13 @@
|
|||
import AccountStore from '../../store/AccountStore';
|
||||
|
||||
let homeserver = AccountStore.getState().homeserver;
|
||||
let homeserverValid = homeserver.match(/.+(\..+){1,}/gm) !== null;
|
||||
|
||||
const updStore = () => {
|
||||
AccountStore.dispatch({ type: 'setHomeserver', homeserver });
|
||||
console.log(AccountStore.getState().homeserver);
|
||||
homeserverValid = homeserver.match(/.+(\..+){1,}/gm) !== null;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class={style.root}>
|
||||
|
@ -11,7 +18,7 @@
|
|||
<p style="text-align:center">
|
||||
To continue, you must choose a homeserver<br/>
|
||||
|
||||
<input type='text' value={homeserver} style="background: #ffeeee06">
|
||||
<input type='text' bind:value={homeserver} on:input={updStore} style="background: #ffeeee06">
|
||||
<br/>
|
||||
|
||||
<button>What is a homeserver?</button>
|
||||
|
@ -19,5 +26,11 @@
|
|||
</p>
|
||||
<p style="text-align:center">
|
||||
<button class="primary">Choose {homeserver}</button>
|
||||
{#if (!homeserverValid)}
|
||||
<br/>
|
||||
<span style='font-size:10pt;color:darkred'>
|
||||
Error: Invalid URL
|
||||
</span>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
Loading…
Reference in New Issue