Skip to content

✨ 🛍️ 🛠️ Fix/sendmodelonevent crash#224

Merged
kcw-grunt merged 6 commits into
developfrom
fix/sendmodelonevent-crash
Apr 27, 2026
Merged

✨ 🛍️ 🛠️ Fix/sendmodelonevent crash#224
kcw-grunt merged 6 commits into
developfrom
fix/sendmodelonevent-crash

Conversation

@kcw-grunt

@kcw-grunt kcw-grunt commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

📱 Description

Fixes a crash in the SendViewModel when toggling between fiat and LTC currencies by refactoring the currency rate lookup to use CurrencyDataGetter instead of relying on potentially stale selectedCurrency.rate. Also improves the icon tint handling in PasscodeKeypad to respect theme colors and adds shop feature strings across all supported locales. This also includes the Shop design and the localizations

Platform

  • Android

🎯 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Refactoring (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement

📋 Changes

New Components Added

  • CurrencyDataGetter dependency injection in SendViewModel to fetch current exchange rates safely

Modifications

  • SendViewModel.kt

    • Added CurrencyDataGetter as a constructor dependency
    • Refactored OnToggleFiatOrLTC event handler to fetch currency rates via currencyDataGetter.getCurrencyByIso() instead of using stale selectedCurrency.rate
    • Added null-safety guard with .takeIf { it > 0f } to prevent crashes when rates haven't loaded
    • Fixed amountInLitoshi calculation logic to correctly handle LTC↔fiat conversions using the constant ONE_LITECOIN_OF_LITOSHIS
  • PasscodeKeypad.kt

    • Added imports for LocalContentColor and takeOrElse
    • Removed explicit containerColor = Color.Transparent from delete button colors
    • Updated delete button icon tint to use MaterialTheme.typography.headlineMedium.color.takeOrElse { LocalContentColor.current } for proper theme-aware rendering
  • SendViewModelTest.kt

    • Added currencyDataGetter mock dependency
    • Created reusable usdCurrency test fixture
    • Updated test setup to mock getCurrencyByIso() calls
    • Refactored settings update propagates currency and darkMode test to configure currencyDataGetter for new currencies
    • Refactored toggle does not crash regression tests to use currencyDataGetter mocking instead of relying on selectedCurrency.rate
    • Removed outdated comment block describing JNI injection patterns
  • Localization files (25 language variants)

    • Added shop_title and shop_tagline string resources to all supported locales (ar, de, es, fa, fr, hi, in, it, ja, ko, nl, pa, pl, pt-rBR, ru, sv, th, tr, uk, zh-rCN, zh-rTW)
    • Fixed trailing newline issues in XML files
  • build.gradle.kts

    • Bumped versionCode from 202506326 to 202506327

Removals

  • None

📊 Statistics

  • Additions: 206 lines
  • Deletions: 100 lines
  • Files Changed: 28
  • Commits: 3

🔗 Related Issues

  • Fixes crash in SendViewModel when toggling fiat/LTC conversion

🧪 Tests Status

  • Tests ran successfully locally?
  • Added more tests? How many? Updated 3 existing tests; refactored regression test suite for OnToggleFiatOrLTC
  • Code coverage percentage of the codebase: __%

📸 Screenshots/Videos

Shop Bento
shop

🎯 Reviewers

@kcw-grunt, @josikie


kcw-grunt and others added 2 commits April 27, 2026 11:36
Refactored the tests
Fixes SendViewModel onEvent
Fixes send keypad
Languages updated: ar, de, es, fa, fr, hi, in, it, ja, ko, nl, pa, pl, pt-rBR, ru, sv, th, tr, uk, zh-rCN, zh-rTW
Triggered by: c37769d
@kcw-grunt kcw-grunt closed this Apr 27, 2026
@kcw-grunt kcw-grunt reopened this Apr 27, 2026
@kcw-grunt kcw-grunt changed the title Fix/sendmodelonevent crash ✨ 🛍️ 🛠️ Fix/sendmodelonevent crash Apr 27, 2026
@gruntsoftware gruntsoftware deleted a comment from github-actions Bot Apr 27, 2026
@kcw-grunt
kcw-grunt merged commit c792f3e into develop Apr 27, 2026
2 checks passed
@kcw-grunt
kcw-grunt deleted the fix/sendmodelonevent-crash branch April 27, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant