fix some bugs
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user