Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
BugFixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwa-Raghavendra committed Apr 26, 2022
1 parent c622eab commit f2c709b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CalcIncomeExpenseAct @Inject constructor(
ExchangeAct.Input(
data = ExchangeData(
baseCurrency = baseCurrency,
fromCurrency = acc.currency.toOption()
fromCurrency = (acc.currency ?: baseCurrency).toOption()
),
amount = it
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CalcWalletBalanceAct @Inject constructor(
ExchangeAct.Input(
data = ExchangeData(
baseCurrency = baseCurrency,
fromCurrency = it.account.currency.toOption(),
fromCurrency = (it.account.currency ?: baseCurrency).toOption(),
toCurrency = balanceCurrency
),
amount = it.balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class SettingsViewModel @Inject constructor(

_showNotifications.value = sharedPrefs.getBoolean(SharedPrefs.SHOW_NOTIFICATIONS, true)

_treatTransfersAsIncomeExpense.value =
sharedPrefs.getBoolean(SharedPrefs.TRANSFERS_AS_INCOME_EXPENSE, false)

_opSync.value = OpResult.success(ioThread { ivySync.isSynced() })

TestIdlingResource.decrement()
Expand Down Expand Up @@ -315,7 +318,10 @@ class SettingsViewModel @Inject constructor(
viewModelScope.launch {
TestIdlingResource.increment()

sharedPrefs.putBoolean(SharedPrefs.TRANSFERS_AS_INCOME_EXPENSE, treatTransfersAsIncomeExpense)
sharedPrefs.putBoolean(
SharedPrefs.TRANSFERS_AS_INCOME_EXPENSE,
treatTransfersAsIncomeExpense
)
_treatTransfersAsIncomeExpense.value = treatTransfersAsIncomeExpense

TestIdlingResource.decrement()
Expand Down

0 comments on commit f2c709b

Please sign in to comment.