fix some things

This commit is contained in:
2026-09-14 12:57:53 +03:30
parent 569e62fef4
commit 71da064cab
6 changed files with 78 additions and 11 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ export type ProductImageSource = {
file?: { id?: number | null; src?: string | null; full_src?: string | null; url?: string | null } | null
file_id?: number | string | null
img?: string | null
image?: string | null
group_type?: string | null
} | null | undefined
@@ -103,7 +104,7 @@ export function getProductFallbackImage(product?: ProductImageSource): string {
}
export function resolveProductImageSrc(product?: ProductImageSource): string {
const remoteSrc = product?.file?.full_src || product?.file?.url || product?.file?.src
const remoteSrc = product?.file?.full_src || product?.file?.url || product?.file?.src || product?.image || product?.img
if (isUsableImageSrc(remoteSrc)) {
const url = absolutizeImageUrl(remoteSrc!.trim())
const version = product?.file_id ?? product?.file?.id
+2 -2
View File
@@ -277,7 +277,7 @@ export function getTvProductBuyPrice(product?: Product | null): number {
}
const unit = tvBuyUnitPrice(product)
if (unit > 0) {
return unit + resolveProductCashFeeBuyRial(product, unit)
return unit
}
return getProductBuyPrice(product)
}
@@ -288,7 +288,7 @@ export function getTvProductSellPrice(product?: Product | null): number {
}
const unit = tvSellUnitPrice(product)
if (unit > 0) {
return unit - resolveProductCashFeeSellRial(product, unit)
return unit
}
return getProductSellPrice(product)
}