Unify store-closed messaging when the market is closed or has no quote.

Treat missing quotes as closed across home and products, show only the admin closed_message as hint, and block trading with consistent notices.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-11 12:42:56 +02:00
co-authored by Cursor
parent 1000df5931
commit 0109f3a744
12 changed files with 99 additions and 82 deletions
@@ -13,7 +13,7 @@
/>
</div>
<div class="status-box__title">{{ statusTitle }}</div>
<div class="status-box__hint">{{ statusHint }}</div>
<div v-if="statusHint" class="status-box__hint">{{ statusHint }}</div>
</div>
</template>
@@ -55,8 +55,9 @@ import { useUserStore } from '@/store/userStore'
import { getTradeBuyPrice, lastPrice, percentPriceChanged, price } from '@/utils/price'
import {
NO_QUOTE_MESSAGE,
STORE_CLOSED_TITLE,
getPriceDisplayState,
getStoreClosedMessage,
getStoreClosedHint,
} from '@/utils/storeHours'
import Vue3Odometer from 'vue3-odometer'
import 'odometer/themes/odometer-theme-default.css'
@@ -67,16 +68,12 @@ const userStore = useUserStore()
const displayState = computed(() => getPriceDisplayState())
const statusTitle = computed(() =>
displayState.value === 'closed' ? 'فروشگاه بسته است' : NO_QUOTE_MESSAGE
displayState.value === 'closed' ? STORE_CLOSED_TITLE : NO_QUOTE_MESSAGE
)
const statusHint = computed(() => {
if (displayState.value === 'closed') {
const custom = userStore.getValueByKey('closed_message')
if (typeof custom === 'string' && custom.trim()) {
return custom.replace(/<[^>]*>/g, '').trim()
}
return getStoreClosedMessage()
return getStoreClosedHint(userStore.getValueByKey('closed_message'))
}
return 'در حال حاضر مظنه‌ای برای نمایش وجود ندارد.'
})