Skip to content

Commit

Permalink
fix pro tag display (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
formsdev authored Feb 6, 2024
1 parent 418054a commit 2274bd1
Showing 1 changed file with 12 additions and 43 deletions.
55 changes: 12 additions & 43 deletions client/components/global/ProTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,49 +36,18 @@
</div>
</template>

<script>
<script setup>
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 {
name: 'ProTag',
components: {PricingTable, Modal},
props: {},
setup () {
const authStore = useAuthStore()
const workspacesStore = useWorkspacesStore()
return {
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()
},
}
}
const authStore = useAuthStore()
const workspacesStore = useWorkspacesStore()
const user = computed(() => authStore.user)
const workspace = computed(() => workspacesStore.getCurrent)
const showPremiumModal = ref(false)
const shouldDisplayProTag = computed(() => {
if (!useRuntimeConfig().public.paidPlansEnabled) return false
if (!user.value || !workspace.value) return true
return !(workspace.value.is_pro)
})
</script>

0 comments on commit 2274bd1

Please sign in to comment.