Skip to content

Fix 68 TypeScript compilation errors across codebase#453

Merged
jamespepper81 merged 3 commits into
mainfrom
dev
Jan 11, 2026
Merged

Fix 68 TypeScript compilation errors across codebase#453
jamespepper81 merged 3 commits into
mainfrom
dev

Conversation

@jamespepper81
Copy link
Copy Markdown
Contributor

This pull request focuses on improving type safety, error handling, and code robustness across multiple screens and components in the app. The main changes include stricter type annotations for callback functions and data mapping, safer access to optional service methods, and improved handling of potential null or undefined values. These updates help prevent runtime errors and make the codebase more maintainable.

Type Safety Improvements:

  • Added explicit type annotations (e.g., UTXO, Transaction) to callback functions, array mapping, and filtering in files such as coin-control.tsx, transaction-details.tsx, transaction-explorer.tsx, and transaction-history.tsx to ensure type correctness and prevent potential runtime errors. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

  • Updated the ExtendedTransactionDetails interface in transaction-explorer.tsx to more accurately model possible transaction detail responses and preserve type safety, including optional and union-typed fields.

Robustness and Error Handling:

  • Added checks for the existence of service methods such as clearAddressCache and getFirstUnusedReceivingAddress in receive.tsx to prevent errors if these methods are undefined. [1] [2] [3]

  • Improved fallback logic for accessing price data in address-details.tsx and for handling potentially undefined bitcoinPrice in transaction-explorer.tsx. [1] [2] [3]

Component and Styling Updates:

  • Updated the BitSleuthButton and BitSleuthCard components to use the lightTheme and improved the mapping of button variants to theme variants for consistent styling. [1] [2] [3]

  • Added a disabledActionButton style for action buttons in transaction-details.tsx to visually indicate disabled state.

Miscellaneous Improvements:

  • Changed the event subscription type from EmitterSubscription to NativeEventSubscription in _layout.tsx for better compatibility with the React Native API. [1] [2]

  • Fixed loading state logic in the wallet addresses screen to use the correct data source for determining if addresses are loading.

Copilot AI and others added 3 commits January 11, 2026 19:31
Co-authored-by: jamespepper81 <84083764+jamespepper81@users.noreply.github.com>
Fix 68 TypeScript compilation errors across codebase
@jamespepper81 jamespepper81 merged commit 1adac08 into main Jan 11, 2026
12 of 13 checks passed
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.

2 participants