fix bug of main-page for guest

This commit is contained in:
2026-10-17 14:12:18 +03:30
parent 9487490981
commit 5e181fdae9
7 changed files with 39 additions and 30 deletions
@@ -1,6 +1,7 @@
import { computed, ref, watch } from 'vue'
import { getAllPrices } from '@/api/home'
import { getAllPrices, getPublicChartPrices } from '@/api/home'
import { getProductsCatalog, getProductsCatalogRef } from '@/composables/useProductsCatalog'
import { getToken } from '@/utils'
import { getTradeBuyPrice, getTradeSellPrice } from '@/utils/price'
export type ChartMetalType = 'katod' | 'maftol' | 'shamsh'
@@ -132,7 +133,7 @@ async function fetchPrices(force = false) {
chartFetchPromise = (async () => {
try {
chartLoading.value = true
const response = await getAllPrices()
const response = await (getToken() ? getAllPrices() : getPublicChartPrices())
const data = resolvePricesMap(response)
cachedPrices.value = data
applyTimelineFromCache()
@@ -149,6 +150,14 @@ async function fetchPrices(force = false) {
}
async function loadMetalChartOffsets(force = false) {
if (!getToken()) {
if (!metalOffsetLoaded) {
syncChartSeries()
metalOffsetLoaded = true
}
return
}
if (!force && metalOffsetLoaded && catalogProducts.value.length > 0) {
return
}
+1 -1
View File
@@ -221,7 +221,7 @@
</div>
<div
v-if="variant === 'desktop' && !isRegister"
v-if="isRegister && variant === 'desktop'"
class="dauth-switch"
>
<span>حساب کاربری ندارید؟</span>
-2
View File
@@ -8,9 +8,7 @@
<p class="dauth-card__subtitle">برای ادامه، رمز ورود خود را انتخاب کنید.</p>
</header>
<header v-else class="dauth-card__header">
<p class="dauth-card__eyebrow">حساب جدید</p>
<h2 class="dauth-card__title">ثبت نام</h2>
<p class="dauth-card__subtitle">اطلاعات خود را برای ایجاد حساب وارد کنید</p>
</header>
<Login