If we don't have a price for "single price" query then return empty price

This commit is contained in:
nymkappa 2023-02-23 18:40:13 +09:00
parent 2d03332333
commit 58f886b337
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -82,6 +82,9 @@ export class PriceService {
return this.singlePriceObservable$.pipe(
map((conversion) => {
if (conversion.prices.length <= 0) {
return this.getEmptyPrice();
}
return {
price: {
USD: conversion.prices[0].USD, EUR: conversion.prices[0].EUR, GBP: conversion.prices[0].GBP, CAD: conversion.prices[0].CAD,