frontend: disabled button while processing password reset
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
<script>
|
||||
import { applyAction, enhance } from '$app/forms';
|
||||
import SmallLoader from '$lib/components/SmallLoader.svelte';
|
||||
import { receive, send } from '$lib/utils/helpers';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
/** @type {import('./$types').ActionData} */
|
||||
export let form;
|
||||
|
||||
let loading = false;
|
||||
/** @type {import('./$types').SubmitFunction} */
|
||||
const handleRequestChange = async () => {
|
||||
loading = true;
|
||||
return async ({ result }) => {
|
||||
await applyAction(result);
|
||||
loading = false;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@@ -40,6 +44,10 @@
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<button class="button-dark">{$t('confirm')}</button>
|
||||
{#if loading}
|
||||
<SmallLoader width={30} message={$t('loading.please_wait')} />
|
||||
{:else}
|
||||
<button class="button-dark" disabled={loading}>{$t('confirm')}</button>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user