Skip to content

Commit

Permalink
fix(one): isSubscriber check
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 17, 2024
1 parent 3a24493 commit 58737cd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/stores/one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ export const useOneStore = defineStore('one', () => {
}, 0) ?? 0
})

const isSubscriber = computed(() => (
!http.url ||
auth.user?.isAdmin ||
subscription.value?.isActive ||
monthlyTotal.value >= 299
))

const one = computed(() => {
return auth.user?.sponsorships.find(s => s.tierName.startsWith('sub_') && s.isActive)
})
Expand All @@ -89,6 +82,16 @@ export const useOneStore = defineStore('one', () => {
return auth.user?.sponsorships.find(s => s.platform === 'patreon' && s.isActive)
})

const isSubscriber = computed(() => (
!http.url ||
auth.user?.isAdmin ||
subscription.value?.isActive ||
github.value?.isActive ||
discord.value?.isActive ||
patreon.value?.isActive ||
monthlyTotal.value >= 2.99
))

onMounted(async () => {
if (sessionId.value) await activate()
})
Expand Down

0 comments on commit 58737cd

Please sign in to comment.