Keep signer-not-responding toast; drop only the dead Details action button
All checks were successful
CI / lint-check-build (pull_request) Successful in 4m14s

This commit is contained in:
hudson 2026-09-17 16:40:09 -04:00
parent 1cff79dba2
commit ce8920123f

View file

@ -12,7 +12,7 @@
import {goto} from "$app/navigation"
import {page} from "$app/stores"
import {context as pomadeContext} from "@pomade/core"
import {sync} from "@welshman/store"
import {sync, throttled} from "@welshman/store"
import {setNip55Plugin} from "@welshman/signer"
import * as util from "@welshman/util"
import * as lib from "@welshman/lib"
@ -26,6 +26,7 @@
import {setupLogging} from "@app/logger"
import "@app/policies"
import {restoreSession} from "@app/session"
import {signerRequests} from "@app/signer"
import {wallet} from "@app/lightning"
import {kv, ss, storage} from "@app/storage"
import {device} from "@app/device"
@ -235,6 +236,28 @@
}),
)
// Listen for signer errors, report to user via toast
unsubscribers.push(
throttled(10_000, signerRequests).subscribe($requests => {
if ($toast) return
const longCutoff = Date.now() - 30_000
const shortCutoff = Date.now() - 10_000
const pending = $requests.filter(r => !r.finishedAt && r.startedAt < longCutoff)
const completed = $requests.filter(r => r.finishedAt && r.finishedAt > shortCutoff)
const showPendingError = pending.length > 10
const showCompletedError = completed.length > 5 && completed.filter(r => r.ok).length === 0
if (showPendingError || showCompletedError) {
pushToast({
theme: "error",
timeout: 60_000,
message: "Your signer isn't responding.",
})
}
}),
)
// Sync theme and font size
unsubscribers.push(
activeTheme.subscribe($activeTheme => {