fix pro tag display (#311)

This commit is contained in:
formsdev 2024-02-06 16:00:59 +05:30 committed by GitHub
parent 418054a9b2
commit 2274bd1abd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 42 deletions

View File

@ -36,49 +36,18 @@
</div> </div>
</template> </template>
<script> <script setup>
import { computed } from 'vue' import { computed } from 'vue'
import Modal from './Modal.vue'
import { useAuthStore } from '../../stores/auth';
import { useWorkspacesStore } from '../../stores/workspaces';
import PricingTable from "../pages/pricing/PricingTable.vue";
export default { const authStore = useAuthStore()
name: 'ProTag', const workspacesStore = useWorkspacesStore()
components: {PricingTable, Modal}, const user = computed(() => authStore.user)
props: {}, const workspace = computed(() => workspacesStore.getCurrent)
const showPremiumModal = ref(false)
setup () { const shouldDisplayProTag = computed(() => {
const authStore = useAuthStore() if (!useRuntimeConfig().public.paidPlansEnabled) return false
const workspacesStore = useWorkspacesStore() if (!user.value || !workspace.value) return true
return { return !(workspace.value.is_pro)
user : computed(() => authStore.user), })
currentWorkSpace : computed(() => workspacesStore.getCurrent())
}
},
data() {
return {
showPremiumModal: false,
checkoutLoading: false
}
},
computed: {
shouldDisplayProTag() {
if (!this.$config.paid_plans_enabled) return false
if (!this.user || !this.currentWorkSpace) return true
return !(this.currentWorkSpace.is_pro)
},
},
mounted() {
},
methods: {
openChat() {
useCrisp().openAndShowChat()
},
}
}
</script> </script>