diff --git a/src/utils/productTradeOpen.ts b/src/utils/productTradeOpen.ts index 9104311..cb355d4 100644 --- a/src/utils/productTradeOpen.ts +++ b/src/utils/productTradeOpen.ts @@ -34,7 +34,8 @@ export function isProductTradingHoursOpen( auto_close_at?: string | null } | null, ) { - if (!product) return false + // روت /gold محصول را prop نمی‌گیرد؛ نبود محصول یعنی ساعت محصول اعمال نشود (مثل open_buy) + if (!product) return true if (isOutsideProductActivationWindow(product)) return false if (typeof product.trade_open === 'boolean') return product.trade_open return product.show === true diff --git a/src/views/base/gold/index.vue b/src/views/base/gold/index.vue index 380c05c..9f8562b 100644 --- a/src/views/base/gold/index.vue +++ b/src/views/base/gold/index.vue @@ -27,7 +27,7 @@ class="w-full h-10 flex items-center justify-center font-bold rounded-full transition-all" :class="isBuy ? 'bg-green-600 text-white shadow-sm' : 'text-green-600'" @click.stop="setIsBuy(true)" - :style="!isProductBuyOpen(props?.ProductItem) ? 'pointer-events: none; opacity: 0.35;' : ''" + :style="!isProductBuyOpen(tradeProduct) ? 'pointer-events: none; opacity: 0.35;' : ''" > خرید @@ -35,7 +35,7 @@ class="w-full h-10 flex items-center justify-center font-bold rounded-full transition-all" :class="!isBuy ? 'bg-red-600 text-white shadow-sm' : 'text-red-600'" @click.stop="setIsBuy(false)" - :style="!isProductSellOpen(props?.ProductItem) ? 'pointer-events: none; opacity: 0.35;' : ''" + :style="!isProductSellOpen(tradeProduct) ? 'pointer-events: none; opacity: 0.35;' : ''" > فروش @@ -98,7 +98,7 @@ -->
- {{ formatCashWalletBalanceText(usePriceWithoutType(cashWalletBalance), props?.ProductItem?.group_type) }} + {{ formatCashWalletBalanceText(usePriceWithoutType(cashWalletBalance), tradeProduct?.group_type) }}
@@ -241,7 +241,7 @@