Skip to content

Fix MAX button broken in PLOT mode + remove unnecessary 5s delays #638

@realproject7

Description

@realproject7

Two related UX bugs

1. MAX button broken in PLOT mode

In `TradingWidget.tsx`, `handleBuyMax` always calls `getZapQuote()` regardless of whether the user is buying with PLOT directly. When `payToken === "PLOT"` and Zap is available, `isPlotMode` is false so it tries the Zap quote — which silently fails since PLOT is the intermediate token, not a Zap input. The MAX button does nothing in PLOT mode.

Fix: Check `isPlotMode` in `handleBuyMax` and use the direct bonding curve quote instead of Zap when buying with PLOT.

2. Unnecessary 5-second delays after tx confirmation

Both `DonateWidget.tsx` (line 94) and `usePublish.ts` (line 116) have:
```typescript
await new Promise((r) => setTimeout(r, 5000));
```

This was for "RPC propagation on Base Sepolia" but is unnecessary on mainnet Base with 2-second block times. The receipt is already confirmed before this delay runs.

Fix: Remove the 5-second delays. If any propagation buffer is needed, 1 second is sufficient.

Files to modify

  • `src/components/TradingWidget.tsx` — fix `handleBuyMax` for PLOT mode
  • `src/components/DonateWidget.tsx` — remove/reduce 5s delay
  • `src/hooks/usePublish.ts` — remove/reduce 5s delay

Branch

`task/638-ux-fixes`

Acceptance criteria

  • MAX button works correctly when buying with PLOT
  • No 5-second delays after tx confirmation
  • Build passes

Self-Verification (T3)

  • Run npm run dev, go to a story page, select PLOT as pay token
  • Click MAX button — verify it fills in the correct max amount (not silent failure)
  • Create a storyline — verify no 5-second delay after tx confirmation before indexing
  • Make a donation — verify no 5-second delay after tx confirmation
  • Run npm run build — no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions