Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Mar 5, 2024
1 parent 14db5ba commit b8813ed
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions web/src/routes/debug/utilities/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,21 @@
import {createExecutor, enableAnvilLogging, increaseBlockTime} from '$lib/utils/debug';
import DebugWrapper from '../DebugWrapper.svelte';
let error: any;
let state: 'addTime' | undefined;
async function addTime(numHours: number) {
try {
state = 'addTime';
await increaseBlockTime(numHours * 3600);
} catch (err) {
} finally {
state = undefined;
}
}
$: date = new Date($time.timestamp * 1000);
let hours = 1;
const execute_increaseBlockTime = createExecutor(increaseBlockTime);
</script>

<DebugWrapper>
<p slot="title">Date/Time: {date.toLocaleDateString() + ` ` + date.toLocaleTimeString()}</p>

{#if error}
{error.message}
<button class="error" on:click={() => (error = undefined)}>OK</button>
{:else}
<Executor func={increaseBlockTime} args={[1 * 3600]}>Add 1 hours</Executor>
<Executor func={increaseBlockTime} args={[23 * 3600]}>Add 23 hours</Executor>
<form class="add-x-hours">
<label for="hours" />
<input id="hours" type="number" bind:value={hours} />
<Executor func={increaseBlockTime} args={[hours * 3600]}>Add {hours} hours</Executor>
</form>
{/if}
<Executor func={increaseBlockTime} args={[1 * 3600]}>Add 1 hours</Executor>
<Executor func={increaseBlockTime} args={[23 * 3600]}>Add 23 hours</Executor>
<form class="add-x-hours">
<label for="hours" />
<input id="hours" type="number" bind:value={hours} />
<Executor func={increaseBlockTime} args={[hours * 3600]}>Add {hours} hours</Executor>
</form>
</DebugWrapper>

<!-- <Executor func={enableAnvilLogging}>Enable Anvil Logging</Executor> -->
Expand Down

0 comments on commit b8813ed

Please sign in to comment.