refactor(billing): gate multi-currency on MULTIPLE_CURRENCY_SUPPORTED config instead of feature flag

This commit is contained in:
Tanmay Deep Sharma
2026-06-15 17:57:44 +05:30
parent e1d512cddd
commit 8a760da6eb
12 changed files with 59 additions and 34 deletions
@@ -27,8 +27,7 @@ import ButtonV4 from 'next/button/Button.vue';
const router = useRouter();
const { t } = useI18n();
const { currentAccount, isOnChatwootCloud, isCloudFeatureEnabled } =
useAccount();
const { currentAccount, isOnChatwootCloud } = useAccount();
const {
captainEnabled,
captainLimits,
@@ -39,6 +38,7 @@ const {
} = useCaptain();
const uiFlags = useMapGetter('accounts/getUIFlags');
const globalConfig = useMapGetter('globalConfig/get');
const store = useStore();
const BILLING_REFRESH_ATTEMPTED = 'billing_refresh_attempted';
@@ -138,9 +138,9 @@ const handleBillingPageLogic = async () => {
const isSwitchingCurrency = computed(() => uiFlags.value.isSwitchingCurrency);
// Currency switching is rolled out per-account via the billing_currency_switch feature flag.
const showCurrencyToggle = computed(() =>
isCloudFeatureEnabled('billing_currency_switch')
// Currency switching is shown only when multi-currency billing is enabled for the installation.
const showCurrencyToggle = computed(
() => globalConfig.value.multipleCurrencySupported
);
const currentBillingCurrency = computed(() =>
@@ -25,6 +25,7 @@ const {
DISABLE_USER_PROFILE_UPDATE: disableUserProfileUpdate,
DEPLOYMENT_ENV: deploymentEnv,
ACTIVE_PLATFORM_BANNERS: activePlatformBanners,
MULTIPLE_CURRENCY_SUPPORTED: multipleCurrencySupported,
} = window.globalConfig || {};
const state = {
@@ -51,6 +52,7 @@ const state = {
widgetBrandURL,
isEnterprise: parseBoolean(isEnterprise),
activePlatformBanners: activePlatformBanners || [],
multipleCurrencySupported: parseBoolean(multipleCurrencySupported),
};
export const getters = {