From 9d87fb8e4b2093f5c9daf212d2bb5db0f44ef59b Mon Sep 17 00:00:00 2001
From: 0o-de-lally <>
Date: Tue, 5 Dec 2023 13:16:40 -0500
Subject: [PATCH] responsive miner toggle
---
src/components/miner/ToggleMiner.svelte | 20 ++++++++++++++++----
src/modules/miner_invoke.ts | 12 ++++++++----
src/modules/miner_toggle.ts | 5 +----
3 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/components/miner/ToggleMiner.svelte b/src/components/miner/ToggleMiner.svelte
index 1c2e21c3..2da5ead1 100644
--- a/src/components/miner/ToggleMiner.svelte
+++ b/src/components/miner/ToggleMiner.svelte
@@ -1,13 +1,25 @@
-
+ {#if !checking}
+
+ {:else}
+
+ {/if}
diff --git a/src/modules/miner_invoke.ts b/src/modules/miner_invoke.ts
index e0f096dd..fc0aa9c4 100644
--- a/src/modules/miner_invoke.ts
+++ b/src/modules/miner_invoke.ts
@@ -156,16 +156,20 @@ export const startBacklogListener = async () => {
.then((res) => {
responses.set(res as string)
backlogListenerReady.set(true)
+ minerLoopEnabled.set(true)
return res
})
.catch((e: CarpeError) => {
- let be_quiet = false
+ let quiet_errors = false
if (e.uid == 104) {
- // check for know error: key not found after upgrade
+ // check for known error: key not found after upgrade
isKeyError.set(true)
- be_quiet = true
+ backlogListenerReady.set(false)
+ minerLoopEnabled.set(false)
+
+ quiet_errors = true
}
- raise_error(e, be_quiet, 'startBacklogListener')
+ raise_error(e, quiet_errors, 'startBacklogListener')
})
}
diff --git a/src/modules/miner_toggle.ts b/src/modules/miner_toggle.ts
index d96e5195..0fbf181a 100644
--- a/src/modules/miner_toggle.ts
+++ b/src/modules/miner_toggle.ts
@@ -22,10 +22,7 @@ export const enableMining = async (): Promise => {
// if the user has stuck proofs, we will show an error screen with a button for
// manually triggering the backlog.
- startBacklogListener()
- .then(carpeTick)
- .then(() => minerLoopEnabled.set(true))
- .then(maybeTowerOnce)
+ startBacklogListener().then(carpeTick).then(maybeTowerOnce)
looper = setInterval(() => setProofPercent(), 5000)
}