Fixed client showing wrong spool price if overridden to 0
Resolves #431
This commit is contained in:
@@ -56,7 +56,7 @@ function collapseSpool(element: ISpool): ISpoolCollapsed {
|
|||||||
} else {
|
} else {
|
||||||
filament_name = element.filament.name ?? element.filament.id.toString();
|
filament_name = element.filament.name ?? element.filament.id.toString();
|
||||||
}
|
}
|
||||||
if (!element.price) {
|
if (element.price === undefined) {
|
||||||
element.price = element.filament.price;
|
element.price = element.filament.price;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export const SpoolShow: React.FC<IResourceComponentsProps> = () => {
|
|||||||
|
|
||||||
const spoolPrice = (item: ISpool) => {
|
const spoolPrice = (item: ISpool) => {
|
||||||
let spoolPrice = "";
|
let spoolPrice = "";
|
||||||
if (!item.price) {
|
if (item.price === undefined) {
|
||||||
spoolPrice = `${item.filament.price}`;
|
spoolPrice = `${item.filament.price}`;
|
||||||
return spoolPrice;
|
return spoolPrice;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user