fix some bugs

This commit is contained in:
2026-08-03 11:53:14 +03:30
parent 57895c129e
commit 82e72b9811
3 changed files with 53 additions and 7 deletions
+15
View File
@@ -64,6 +64,9 @@ export const supportChatMenuEnabledSetting = ref(false)
/** reactive — سوییچ دیپلوی show_to_users_chat (برای مخفی کردن has_chat در تنظیمات عادی) */
export const showToUsersChatSetting = ref(false)
/** reactive — سوییچ دیپلوی price_channel_access (گروه کانال در تنظیمات عادی) */
export const priceChannelAccessSetting = ref(false)
export const accountingProviderSetting = ref<AccountingProvider>('none')
let tahesabEnabledFromSettings: boolean | null = null
@@ -167,6 +170,10 @@ export function setShowToUsersChatFromSettings(value: boolean): void {
showToUsersChatSetting.value = value
}
export function setPriceChannelAccessFromSettings(value: boolean): void {
priceChannelAccessSetting.value = value
}
let lastShowToUsersChat = ''
let lastHasChat = ''
let lastChatApi = ''
@@ -273,6 +280,13 @@ export function applyPriceProviderFromRows(
}
}
export function applyPriceChannelAccessFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
const row = rows.find((item) => item.key === 'price_channel_access')
if (row) setPriceChannelAccessFromSettings(isSwitchOn(row.value))
}
async function bootstrapSettingsFromApi(): Promise<void> {
if (settingsBootstrapped) return
@@ -295,6 +309,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
applyAppNotificationEnabledFromRows(list)
applySupportChatMenuEnabledFromRows(list)
applyPriceProviderFromRows(list)
applyPriceChannelAccessFromRows(list)
setCachedMainMetal(mainMetalRow?.value)
const { setCachedMainWalletProductIds } = await import('@/components/mobile/utils/wallet')
setCachedMainWalletProductIds(parseMainWalletProductIds(mainWalletRow?.value))