fix: pre-launch UI hardening + KOL reduce-action type, proxy IP relay, settings redesign
Frontend half of the pre-launch audit campaign: - types/index.ts + kol/KolPageClient.tsx: add missing 'reduce' KolAction (backend emits it; frontend lacked the type + color/label maps → undefined styling). Adds ACTION_COLOR/actionLabel/postActionLabel entries. - proxy/[...path]/route.ts: relay real client IP (x-forwarded-for / x-real-ip) so the backend rate limiter buckets per-user instead of per-Next-server (BUG-02). - Settings/BotConfigPanel redesign, paper-mode clarity, copy cleanup. - Assorted page/display fixes, loading states, Pagination component. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,12 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
if (!subscribed) { setErr(isZh ? '钱包尚未订阅,请先去设置页完成订阅。' : 'Wallet not subscribed — subscribe on the Settings page first.'); return }
|
||||
if (autoOn === on) return
|
||||
|
||||
// Claim the busy slot BEFORE awaiting confirmSign — otherwise a rapid
|
||||
// second click on the same pill (or the opposite pill) slips past the
|
||||
// `if (busy) return` guard and queues a second sheet + second signature.
|
||||
// We still clear it in `finally` below.
|
||||
setBusy(true); setErr('')
|
||||
|
||||
// Show pre-signing confirmation sheet before triggering MetaMask
|
||||
const confirmed = await confirmSign(on
|
||||
? {
|
||||
@@ -96,9 +102,8 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
danger: false,
|
||||
}
|
||||
)
|
||||
if (!confirmed) return
|
||||
if (!confirmed) { setBusy(false); return } // release the slot we claimed
|
||||
|
||||
setErr(''); setBusy(true)
|
||||
try {
|
||||
const env = await signRequest({
|
||||
action: 'set_auto_trade', wallet: address,
|
||||
|
||||
Reference in New Issue
Block a user