disable register rule timeout in dev mode
This commit is contained in:
@ -5,9 +5,12 @@
|
|||||||
import { env } from '$env/dynamic/public';
|
import { env } from '$env/dynamic/public';
|
||||||
import { rulesShort } from '$lib/rules';
|
import { rulesShort } from '$lib/rules';
|
||||||
import { RegisterSchema } from './schema';
|
import { RegisterSchema } from './schema';
|
||||||
|
import { dev } from '$app/environment';
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
const modalTimeoutSeconds = dev ? 0 : 30;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
let checkInputs = () => {};
|
let checkInputs = () => {};
|
||||||
let playertype = 'java';
|
let playertype = 'java';
|
||||||
@ -281,14 +284,14 @@
|
|||||||
<!-- svelte-ignore a11y-no-static-element-interactions a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-no-static-element-interactions a11y-click-events-have-key-events -->
|
||||||
<div
|
<div
|
||||||
class="relative w-min"
|
class="relative w-min"
|
||||||
title={rulesModalSecondsOpened < 30
|
title={rulesModalSecondsOpened < modalTimeoutSeconds
|
||||||
? `Regeln können in ${Math.max(
|
? `Regeln können in ${Math.max(
|
||||||
30 - rulesModalSecondsOpened,
|
modalTimeoutSeconds - rulesModalSecondsOpened,
|
||||||
0
|
0
|
||||||
)} Sekunden akzeptiert werden`
|
)} Sekunden akzeptiert werden`
|
||||||
: ''}
|
: ''}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (rulesModalSecondsOpened < 30) {
|
if (rulesModalSecondsOpened < modalTimeoutSeconds) {
|
||||||
errorMessage =
|
errorMessage =
|
||||||
'Bitte lies die Regeln aufmerksam durch. Du kannst erst in einigen Sekunden fortfahren.';
|
'Bitte lies die Regeln aufmerksam durch. Du kannst erst in einigen Sekunden fortfahren.';
|
||||||
}
|
}
|
||||||
@ -296,7 +299,7 @@
|
|||||||
>
|
>
|
||||||
<div class="absolute top-0 left-0 h-full w-full overflow-hidden rounded-lg">
|
<div class="absolute top-0 left-0 h-full w-full overflow-hidden rounded-lg">
|
||||||
<div
|
<div
|
||||||
style="width: {Math.min((rulesModalSecondsOpened / 30) * 100, 100)}%"
|
style="width: {Math.min((rulesModalSecondsOpened / modalTimeoutSeconds) * 100, 100)}%"
|
||||||
class="h-full bg-base-300"
|
class="h-full bg-base-300"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -304,7 +307,7 @@
|
|||||||
id="rules-accept"
|
id="rules-accept"
|
||||||
type="submit"
|
type="submit"
|
||||||
value="Akzeptieren"
|
value="Akzeptieren"
|
||||||
disabled={rulesModalSecondsOpened < 30}
|
disabled={rulesModalSecondsOpened < modalTimeoutSeconds}
|
||||||
containerClass="bg-transparent z-[1] relative"
|
containerClass="bg-transparent z-[1] relative"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
rulesAccepted = true;
|
rulesAccepted = true;
|
||||||
|
Reference in New Issue
Block a user