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

Commit

Permalink
Merge pull request #537 from Giveth/h_2312_create_expense_with_stable…
Browse files Browse the repository at this point in the history
…_coin_currency

Fix create trace (expense form) with stable coin currency (like DAI)
  • Loading branch information
aminlatifi authored Jun 29, 2021
2 parents 12a361f + 71c3716 commit 2e511d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/traces/checkConversionRates.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const checkConversionRates = () => context => {
.service('conversionRates')
.find({ query: { date: new Date(item.date).valueOf(), symbol: fromSymbol } })
.then(conversionRate => {
if (data.token && conversionRate && conversionRate.rates) {
// for having the stable coin in the rate response beside the USD
conversionRate.rates[data.token.symbol] = 1;
}
calculateCorrectEther(conversionRate, item.fiatAmount, item.wei, item.selectedFiatType);
}),
);
Expand All @@ -87,6 +91,10 @@ const checkConversionRates = () => context => {
.service('conversionRates')
.find({ query: { date: new Date(data.date).valueOf(), symbol: fromSymbol } })
.then(conversionRate => {
if (data.token && conversionRate && conversionRate.rates) {
// for having the stable coin in the rate response beside the USD
conversionRate.rates[data.token.symbol] = 1;
}
calculateCorrectEther(conversionRate, data.fiatAmount, data.maxAmount, selectedFiatSymbol);
return context;
});
Expand Down

0 comments on commit 2e511d7

Please sign in to comment.