refactor(billing): gate multi-currency on MULTIPLE_CURRENCY_SUPPORTED config instead of feature flag
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user