Skip to content

fix(settings): wire autoRefreshInterval, defaultMemo, showTestnetWarning, and slippage (#46) - #94

Open
ghzhost wants to merge 1 commit into
StellarSend:mainfrom
ghzhost:fix/settings-wiring-46
Open

fix(settings): wire autoRefreshInterval, defaultMemo, showTestnetWarning, and slippage (#46)#94
ghzhost wants to merge 1 commit into
StellarSend:mainfrom
ghzhost:fix/settings-wiring-46

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Addresses and fixes Issue #46: Settings page: autoRefreshInterval, slippageTolerance, defaultMemo, and showTestnetWarning are all saved but never actually applied anywhere — only network works.

Changes Made

  1. Extracted useSettings hook (src/hooks/useSettings.ts):
    • Centralized access to stored AppSettings under stellarsend_settings.
    • Also syncs stellarsend_refresh_interval and stellarsend_network for interoperability across tabs/components.
  2. autoRefreshInterval:
    • WalletContext.tsx now reads autoRefreshInterval from stellarsend_settings (with fallback to stellarsend_refresh_interval / default 30s).
  3. showTestnetWarning:
    • Layout.tsx now gates the testnet banner on both network === 'testnet' and settings.showTestnetWarning.
  4. defaultMemo:
    • Send.tsx now seeds SendForm's defaultValues with { memo: settings.defaultMemo } when no form values are yet in progress.
  5. slippageTolerance:
    • Added optional slippageTolerance?: string to QuoteRequest in src/types/index.ts.
    • useSendPayment.ts passes settings.slippageTolerance down to quoteApi.getQuote.
  6. Tests:
    • Added unit test suite src/hooks/useSettings.test.ts covering initial state, localStorage loading, updates/key syncing, and reset.
    • All 28 test files and 117 tests pass cleanly (vitest).

Fixes #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant