fix(settings): show Montzar keys when price_provider is empty

Regular settings hid all montzar_* unless price_provider was already
loaded as montzar, so search only found referral_gift_buy_from_montzar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 21:27:20 +03:30
co-authored by Cursor
parent ed326a41d2
commit f6efeeff3e
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -488,8 +488,9 @@ async function initConfig() {
applySupportChatMenuEnabledFromRows(baseData.value)
applyGroupSmsFromRows(baseData.value)
applyCustomerSpecialPricingFromRows(baseData.value)
// در صفحهٔ عادی price_provider و show_to_users_chat و price_channel_access (can_edit=0) نیستند — از کل تنظیمات بخوان
// صفحهٔ عادی price_provider ندارد (can_edit=0) — همیشه از get_settings کامل بخوان
if (
!isSystemMode.value ||
!baseData.value.some((row) => row.key === 'price_provider') ||
!baseData.value.some((row) => row.key === 'show_to_users_chat') ||
!baseData.value.some((row) => row.key === 'price_channel_access') ||
@@ -234,9 +234,10 @@ export function isSettingVisible(key: string | undefined | null): boolean {
if (k === 'fee_conditional_order' && !conditionalOrderEnabledSetting.value) return false
// سوییچ مشتری has_chat فقط وقتی قابلیت چت دیپلوی روشن است
if (k === 'has_chat' && !showToUsersChatSetting.value) return false
// گروه همکار Montzar فقط وقتی منبع قیمت montzar است
if ((k.startsWith('montzar_') || k === 'display_montzar') && priceProviderSetting.value !== 'montzar') {
return false
// Montzar را فقط وقتی منبع قیمت صریحاً چیز دیگری است مخفی کن (خالی = نشان بده)
if (k.startsWith('montzar_') || k === 'display_montzar') {
const provider = (priceProviderSetting.value || '').trim().toLowerCase()
if (provider && provider !== 'montzar') return false
}
// تنظیمات قابل‌ویرایش کانال فقط وقتی دسترسی دیپلوی روشن است
if (PRICE_CHANNEL_PANEL_KEYS.has(k) && !priceChannelAccessSetting.value) return false