Keep gold quotes live from last and apply SSE catalog list so cards refresh without a page reload.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 18:20:06 +03:30
co-authored by Cursor
parent c623a32bb5
commit 3b83eac099
4 changed files with 105 additions and 103 deletions
+6 -32
View File
@@ -101,26 +101,13 @@ export function getProductBaseBuyPrice(product?: Product | null): number {
}
if (isMeltedProductUsingAppPrice(product) || isAppPriceProduct(product)) {
const apiPrice = Number(product.price ?? 0)
const useLast = productUsesLastPriceIfZero(product)
if (!useLast) {
const liveBuy = getTradeBuyPrice(lastPrice.value)
if (liveBuy > 0) {
return applyPriceOffsetPercent(liveBuy, product.price_offset_percent)
}
return 0
}
if (apiPrice > 0) {
return apiPrice
}
const liveBuy = getTradeBuyPrice(lastPrice.value)
if (liveBuy > 0) {
return applyPriceOffsetPercent(liveBuy, product.price_offset_percent)
}
if (productUsesLastPriceIfZero(product) && Number(product.price ?? 0) > 0) {
return Number(product.price ?? 0)
}
return 0
}
@@ -195,26 +182,13 @@ export function getProductBaseSellPrice(product?: Product | null): number {
}
if (isMeltedProductUsingAppPrice(product) || isAppPriceProduct(product)) {
const apiPrice = Number(product.price ?? 0)
const useLast = productUsesLastPriceIfZero(product)
if (!useLast) {
const liveSell = getTradeSellPrice(lastPrice.value)
if (liveSell > 0) {
return applyPriceOffsetPercent(liveSell, product.price_offset_percent)
}
return 0
}
if (apiPrice > 0) {
return apiPrice
}
const liveSell = getTradeSellPrice(lastPrice.value)
if (liveSell > 0) {
return applyPriceOffsetPercent(liveSell, product.price_offset_percent)
}
if (productUsesLastPriceIfZero(product) && Number(product.price ?? 0) > 0) {
return Number(product.price ?? 0)
}
return 0
}