Skip to content

Commit

Permalink
Fix type error caused by CurrencyRateController 18.0.0 breaking c…
Browse files Browse the repository at this point in the history
…hange in state type

- This was masked due to `any` typing of `datamodel` field of `Engine` class
  • Loading branch information
MajorLift committed Aug 1, 2024
1 parent 203c34a commit 2a010d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2036,10 +2036,12 @@ export default {
// TODO: handle `null` currencyRate by hiding fiat values instead
const modifiedCurrencyRateControllerState = {
...CurrencyRateController,
conversionRate:
CurrencyRateController.conversionRate === null
? 0
: CurrencyRateController.conversionRate,
currencyRates: Object.fromEntries(
Object.entries(CurrencyRateController.currencyRates).map(([k, v]) => [
k,
{ ...v, conversionRate: v.conversionRate ?? 0 },
]),
),
};

return {
Expand Down

0 comments on commit 2a010d3

Please sign in to comment.