perf: reduce CPU usage on Bay Trail ATM hardware
- Remove infinite box-shadow glow animations from Buy/Sell buttons on idle screen (expensive on CPU without GPU) - Reduce BTC price polling from 10s to 30s - Reduce LNURL-withdraw polling from 2s to 5s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
aece711450
commit
b7858a08c7
3 changed files with 4 additions and 6 deletions
|
|
@ -299,7 +299,7 @@ function startLnurlCompletionPolling(
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('[LNURL Poll] Error checking status:', e)
|
console.warn('[LNURL Poll] Error checking status:', e)
|
||||||
}
|
}
|
||||||
}, 2000) // Poll every 2 seconds
|
}, 5000) // Poll every 5 seconds
|
||||||
|
|
||||||
// Store cleanup function
|
// Store cleanup function
|
||||||
const session = lnurlSessions.get(uniqueHash)
|
const session = lnurlSessions.get(uniqueHash)
|
||||||
|
|
|
||||||
|
|
@ -998,7 +998,7 @@ export const useAtmStore = defineStore('atm', () => {
|
||||||
else if (currency === 'USD' && localPrice !== null) btcPriceUsd.value = localPrice
|
else if (currency === 'USD' && localPrice !== null) btcPriceUsd.value = localPrice
|
||||||
}
|
}
|
||||||
poll() // immediate first fetch
|
poll() // immediate first fetch
|
||||||
pricePollingInterval = setInterval(poll, 10_000)
|
pricePollingInterval = setInterval(poll, 30_000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopPricePolling() {
|
function stopPricePolling() {
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,7 @@ function handleCashOut() {
|
||||||
>
|
>
|
||||||
<!-- Buy Bitcoin -->
|
<!-- Buy Bitcoin -->
|
||||||
<button
|
<button
|
||||||
class="flex aspect-square w-40 lg:w-[36vh] flex-col items-center justify-center gap-1.5 lg:gap-4 rounded-full border-2 border-bitcoin/50 bg-bitcoin/10 transition-all active:scale-[0.97] animate-zone-glow"
|
class="flex aspect-square w-40 lg:w-[36vh] flex-col items-center justify-center gap-1.5 lg:gap-4 rounded-full border-2 border-bitcoin/50 bg-bitcoin/10 transition-all active:scale-[0.97]"
|
||||||
style="--glow-color: var(--bitcoin)"
|
|
||||||
@click="handleCashIn"
|
@click="handleCashIn"
|
||||||
>
|
>
|
||||||
<BitcoinIcon :size="100" class="shrink-0 w-10 h-10 lg:w-[100px] lg:h-[100px]" />
|
<BitcoinIcon :size="100" class="shrink-0 w-10 h-10 lg:w-[100px] lg:h-[100px]" />
|
||||||
|
|
@ -133,8 +132,7 @@ function handleCashOut() {
|
||||||
|
|
||||||
<!-- Sell Bitcoin -->
|
<!-- Sell Bitcoin -->
|
||||||
<button
|
<button
|
||||||
class="flex aspect-square w-40 lg:w-[36vh] flex-col items-center justify-center gap-1.5 lg:gap-4 rounded-full border-2 border-success/50 bg-success/10 transition-all active:scale-[0.97] animate-zone-glow"
|
class="flex aspect-square w-40 lg:w-[36vh] flex-col items-center justify-center gap-1.5 lg:gap-4 rounded-full border-2 border-success/50 bg-success/10 transition-all active:scale-[0.97]"
|
||||||
style="--glow-color: var(--success)"
|
|
||||||
@click="handleCashOut"
|
@click="handleCashOut"
|
||||||
>
|
>
|
||||||
<span class="text-4xl lg:text-[8vh] leading-none">💵</span>
|
<span class="text-4xl lg:text-[8vh] leading-none">💵</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue