chore: Move bypassUpgradePage logic to upgrade page, now we are not using it in dashboard
This commit is contained in:
@@ -75,13 +75,6 @@ export default {
|
||||
showUpgradePage() {
|
||||
return this.upgradePageRef?.shouldShowUpgradePage;
|
||||
},
|
||||
bypassUpgradePage() {
|
||||
return [
|
||||
'billing_settings_index',
|
||||
'settings_inbox_list',
|
||||
'agent_list',
|
||||
].includes(this.$route.name);
|
||||
},
|
||||
isSidebarOpen() {
|
||||
const { show_secondary_sidebar: showSecondarySidebar } = this.uiSettings;
|
||||
return showSecondarySidebar;
|
||||
@@ -220,11 +213,7 @@ export default {
|
||||
@show-add-label-popup="showAddLabelPopup"
|
||||
/>
|
||||
<main class="flex flex-1 h-full min-h-0 px-0 overflow-hidden">
|
||||
<UpgradePage
|
||||
v-show="showUpgradePage"
|
||||
ref="upgradePageRef"
|
||||
:bypass-upgrade-page="bypassUpgradePage"
|
||||
/>
|
||||
<UpgradePage v-show="showUpgradePage" ref="upgradePageRef" />
|
||||
<div
|
||||
v-if="accountUIFlags.isFetchingLimits"
|
||||
class="flex items-center justify-center w-full h-full"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { computed, defineExpose, defineProps } from 'vue';
|
||||
import { computed, defineExpose } from 'vue';
|
||||
import { useMapGetter } from 'dashboard/composables/store.js';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useAccount } from 'dashboard/composables/useAccount';
|
||||
import { differenceInDays } from 'date-fns';
|
||||
import { useAdmin } from 'dashboard/composables/useAdmin';
|
||||
@@ -10,14 +10,8 @@ import { useI18n } from 'vue-i18n';
|
||||
import NextButton from 'dashboard/components-next/button/Button.vue';
|
||||
import Icon from 'dashboard/components-next/icon/Icon.vue';
|
||||
|
||||
const props = defineProps({
|
||||
bypassUpgradePage: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const { accountId, currentAccount } = useAccount();
|
||||
const { isAdmin } = useAdmin();
|
||||
@@ -40,6 +34,14 @@ const isTrialAccount = computed(() => {
|
||||
return diffDays <= 15;
|
||||
});
|
||||
|
||||
const bypassUpgradePage = computed(() => {
|
||||
return [
|
||||
'billing_settings_index',
|
||||
'settings_inbox_list',
|
||||
'agent_list',
|
||||
].includes(route.name);
|
||||
});
|
||||
|
||||
const limitExceededMessage = computed(() => {
|
||||
const account = currentAccount.value;
|
||||
if (!account?.limits) return '';
|
||||
@@ -82,7 +84,7 @@ const shouldShowUpgradePage = computed(() => {
|
||||
// Hide upgrade page while fetching limits
|
||||
if (accountUIFlags.isFetchingLimits) return false;
|
||||
// Skip upgrade page in Billing, Inbox, and Agent pages
|
||||
if (props.bypassUpgradePage) return false;
|
||||
if (bypassUpgradePage.value) return false;
|
||||
if (!isOnChatwootCloud.value) return false;
|
||||
if (isTrialAccount.value) return false;
|
||||
return isLimitExceeded.value;
|
||||
|
||||
Reference in New Issue
Block a user