Skip to content

ui/ws: deregister epoch_match_summary route - #13

Open
norwnd wants to merge 1 commit into
masterfrom
ui-ws-deregister-epoch_match_summary-route
Open

ui/ws: deregister epoch_match_summary route#13
norwnd wants to merge 1 commit into
masterfrom
ui-ws-deregister-epoch_match_summary-route

Conversation

@norwnd

@norwnd norwnd commented Mar 20, 2023

Copy link
Copy Markdown
Owner

To be consistent with other order-book-related routes, it seems there is no need to keep handling epoch_match_summary when navigated away from /markets page.

// Handle the initial candlestick data.
ws.registerRoute(candlesRoute, (data: BookUpdate) => { this.handleCandlesRoute(data) })
// Handle the candles update on the 'candles' route.
// Handle the candles update.

@norwnd norwnd Mar 20, 2023

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments seems kinda mixed (some refer to ui<->dexc routes, others refer to dexc<->server ones), easier more robust way to go about it is to just get rid of the duplicated part (actual route name) that can easily get out of date, which is why I update these comments like this here.

@norwnd
norwnd force-pushed the master branch 4 times, most recently from ad9d264 to e298e04 Compare November 24, 2024 18:25
@norwnd
norwnd force-pushed the master branch 5 times, most recently from f9959eb to a66bbae Compare January 10, 2025 06:09
@norwnd
norwnd force-pushed the master branch 3 times, most recently from e3c487c to 333e9f6 Compare January 18, 2025 13:45
norwnd pushed a commit that referenced this pull request Apr 16, 2026
…ug fix

Batches the six easy/low-risk cleanup items from T18 into a single
commit, plus a related bug fix discovered during T18#10 research.

T18#6: DCR_ASSET_ID local constant -> shared DCRAssetID
- WalletsPage.tsx previously declared `const DCR_ASSET_ID = 42`
  duplicating the existing `DCRAssetID` export in stores/types.ts.
  Now imports from the shared location.

T18#13: dead createUpdater state in NewWalletForm
- Removed the `const [createUpdater] = useState(null)` line and its
  associated `useNotifications({ createwallet })` handler. The
  handler body had a `if (createUpdater) ...` null check on a
  value that was always null, so the body never ran. Dead code
  from an earlier refactor. Also removed the now-unused
  WalletCreationNote and useNotifications imports.

T18#14: duplicate checkResponse helpers
- services/api.ts and hooks/useApi.ts both exported identical
  `checkResponse` helpers. The canonical location is now
  services/api.ts (where the related postJSON/getJSON/APIResponse
  types live). Migrated 4 importers (DepositAddress,
  WalletConfigForm, TokenApprovalForm, NewWalletForm) and deleted
  the duplicate export from useApi.ts.

T18#4: returnPage typed as free-form string
- Added `type MMLogsReturnPage = 'mm' | 'mmarchives'` to
  router/routes.ts. MMLogsPage now narrows the raw query-param
  string via the union type, and MMArchivesPage assigns through a
  typed local constant. Prevents typos from silently falling
  through to the default 'mm' on either side of the producer/
  consumer boundary.

T18#9: icon-only link a11y in SetVotesModal
- Added `aria-label={tspend.hash.slice(0, 8)... in block explorer}`
  to the tspend explorer `<a>` (was a bare `ico-open` anchor with
  no accessible text) and `aria-label={View proposal: ${name}}`
  to the proposal `<Link>`. Both elements are icon-only so screen
  readers had no fallback text before this change. Matches vanilla's
  visual behavior; vanilla has the same a11y gap.

T18#10: proper TransactionNote type (+ B-L16 dispatch bug fix)
- BridgingPopup's handleTransactionNote previously cast the
  incoming note to an ad-hoc `{ transaction?: { id, timestamp } }`
  shape. Replaced with the existing `TransactionNote` type from
  stores/types.ts.
- Discovered a REAL BUG during the type audit: the popup was
  subscribing to a top-level `transaction` note type that does
  not exist. Vanilla's dispatch flow wraps these inside
  `walletnote` (CoreNote with type='walletnote' and
  payload.route='transaction'); see wallets.ts L2767
  `handleCustomWalletNote` + L2791 `case 'transaction'`. So my
  handler never fired. Fixed by subscribing to `walletnote:`
  instead and unwrapping the payload inline. The cosmetic
  timestamp-refresh behavior that was silently broken now works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant