✨ 🛍️ 🛠️ Fix/sendmodelonevent crash#224
Merged
Merged
Conversation
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
Modified workflow to enable manual dispatch and commented out pull request triggers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📱 Description
Fixes a crash in the SendViewModel when toggling between fiat and LTC currencies by refactoring the currency rate lookup to use
CurrencyDataGetterinstead of relying on potentially staleselectedCurrency.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 localizationsPlatform
🎯 Type of Change
📋 Changes
New Components Added
CurrencyDataGetterdependency injection inSendViewModelto fetch current exchange rates safelyModifications
SendViewModel.kt
CurrencyDataGetteras a constructor dependencyOnToggleFiatOrLTCevent handler to fetch currency rates viacurrencyDataGetter.getCurrencyByIso()instead of using staleselectedCurrency.rate.takeIf { it > 0f }to prevent crashes when rates haven't loadedamountInLitoshicalculation logic to correctly handle LTC↔fiat conversions using the constantONE_LITECOIN_OF_LITOSHISPasscodeKeypad.kt
LocalContentColorandtakeOrElsecontainerColor = Color.Transparentfrom delete button colorsMaterialTheme.typography.headlineMedium.color.takeOrElse { LocalContentColor.current }for proper theme-aware renderingSendViewModelTest.kt
currencyDataGettermock dependencyusdCurrencytest fixturegetCurrencyByIso()callssettings update propagates currency and darkModetest to configurecurrencyDataGetterfor new currenciestoggle does not crashregression tests to usecurrencyDataGettermocking instead of relying onselectedCurrency.rateLocalization files (25 language variants)
shop_titleandshop_taglinestring 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)build.gradle.kts
versionCodefrom 202506326 to 202506327Removals
📊 Statistics
🔗 Related Issues
🧪 Tests Status
OnToggleFiatOrLTC📸 Screenshots/Videos
🎯 Reviewers
@kcw-grunt, @josikie