Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show price for test currencies #292

Merged
merged 1 commit into from
May 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions app/renderer/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ import {isDevelopment} from '../../util-common';

const config = remote.require('./config');

const excludedTestCurrencies = new Set([
'PIZZA',
'BEER',
]);

const getTickerData = async symbol => {
const fallback = {
symbol,
price: 0,
};

const excludedTestCurrencies = [
'PIZZA',
'BEER',
];
if (excludedTestCurrencies.includes(symbol)) {
if (excludedTestCurrencies.has(symbol)) {
return fallback;
}

Expand Down Expand Up @@ -125,6 +126,12 @@ class AppContainer extends Container {
// `currency.price` is the price of the coin in KMD
currency.cmcPriceUsd = currency.price * kmdPriceInUsd;
currency.cmcBalanceUsd = currency.balance * currency.cmcPriceUsd;

// Don't show price for test currencies
if (excludedTestCurrencies.has(currency.symbol)) {
currency.cmcPriceUsd = 0;
currency.cmcBalanceUsd = 0;
}
}

currency.name = getCurrencyName(currency.symbol);
Expand Down