Implemented routing instead of internal state
All checks were successful
/ Build the server (push) Successful in 3m5s
All checks were successful
/ Build the server (push) Successful in 3m5s
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {Button, ButtonGroup, Card, Input, InputAddon} from 'flowbite-svelte';
|
||||
import {Email, Password} from '../icons';
|
||||
import {changeStateFunction, error_banner, info_banner, rpc, state, StateE, workingWrapperO} from '../store';
|
||||
import {error_banner, info_banner, rpc, workingWrapperO} from '../store';
|
||||
import {replace} from 'svelte-spa-router';
|
||||
|
||||
let username = '', username2 = '', password = '', password2 = '';
|
||||
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
if (resp) {
|
||||
info_banner.set('Account created, please wait till an administrator approves it');
|
||||
$state.s = StateE.LOGIN;
|
||||
await replace('/login');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@
|
||||
<Input type="password" placeholder="Repeat password" bind:value={password2} on:keyup={keyUp}></Input>
|
||||
</ButtonGroup>
|
||||
<ButtonGroup class="w-full flex flex-nowrap">
|
||||
<Button class="flex-1 flex-grow" color="primary" outline on:click={changeStateFunction(StateE.LOGIN)}>Login</Button>
|
||||
<Button class="flex-1 flex-grow" color="primary" outline href="#/login">Login</Button>
|
||||
<Button class="flex-1 flex-grow" color="primary" on:click={signup}>Singup</Button>
|
||||
</ButtonGroup>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user