-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0o-de-lally
committed
Dec 5, 2023
1 parent
9cf0768
commit 9d87fb8
Showing
3 changed files
with
25 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
<script lang="ts"> | ||
import { minerLoopEnabled } from '../../modules/miner' | ||
import { toggleMining } from '../../modules/miner_toggle' | ||
let checking = false | ||
const toggle = () => { | ||
checking = true | ||
setTimeout(() => (checking = false), 1000) | ||
toggleMining() | ||
} | ||
</script> | ||
|
||
<main> | ||
<div class="uk-text-center uk-margin" style="position: relative"> | ||
<label class="uk-switch"> | ||
<input type="checkbox" on:click={() => toggleMining()} checked={$minerLoopEnabled} /> | ||
<div class="uk-switch-slider uk-switch-on-off round" /> | ||
</label> | ||
{#if !checking} | ||
<label class="uk-switch"> | ||
<input type="checkbox" on:click={toggle} checked={$minerLoopEnabled} /> | ||
<div class="uk-switch-slider uk-switch-on-off round" /> | ||
</label> | ||
{:else} | ||
<div uk-spinner></div> | ||
{/if} | ||
</div> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters