Skip to content

Commit 2274bd1

Browse files
authored
fix pro tag display (#311)
1 parent 418054a commit 2274bd1

File tree

1 file changed

+12
-43
lines changed

1 file changed

+12
-43
lines changed

client/components/global/ProTag.vue

+12-43
Original file line numberDiff line numberDiff line change
@@ -36,49 +36,18 @@
3636
</div>
3737
</template>
3838

39-
<script>
39+
<script setup>
4040
import { computed } from 'vue'
41-
import Modal from './Modal.vue'
42-
import { useAuthStore } from '../../stores/auth';
43-
import { useWorkspacesStore } from '../../stores/workspaces';
44-
import PricingTable from "../pages/pricing/PricingTable.vue";
4541
46-
export default {
47-
name: 'ProTag',
48-
components: {PricingTable, Modal},
49-
props: {},
50-
51-
setup () {
52-
const authStore = useAuthStore()
53-
const workspacesStore = useWorkspacesStore()
54-
return {
55-
user : computed(() => authStore.user),
56-
currentWorkSpace : computed(() => workspacesStore.getCurrent())
57-
}
58-
},
59-
60-
data() {
61-
return {
62-
showPremiumModal: false,
63-
checkoutLoading: false
64-
}
65-
},
66-
67-
computed: {
68-
shouldDisplayProTag() {
69-
if (!this.$config.paid_plans_enabled) return false
70-
if (!this.user || !this.currentWorkSpace) return true
71-
return !(this.currentWorkSpace.is_pro)
72-
},
73-
},
74-
75-
mounted() {
76-
},
77-
78-
methods: {
79-
openChat() {
80-
useCrisp().openAndShowChat()
81-
},
82-
}
83-
}
42+
const authStore = useAuthStore()
43+
const workspacesStore = useWorkspacesStore()
44+
const user = computed(() => authStore.user)
45+
const workspace = computed(() => workspacesStore.getCurrent)
46+
const showPremiumModal = ref(false)
47+
48+
const shouldDisplayProTag = computed(() => {
49+
if (!useRuntimeConfig().public.paidPlansEnabled) return false
50+
if (!user.value || !workspace.value) return true
51+
return !(workspace.value.is_pro)
52+
})
8453
</script>

0 commit comments

Comments
 (0)