dashboard pricing card login fix

This commit is contained in:
Ben Allfree 2024-11-14 21:14:04 -08:00
parent f9ef2a11c4
commit 72c580a738
2 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,11 @@
]
export let startDate: Date | null = null
export let endDate: Date | null = null
const logInFirst = () => {
alert('Please log in and verify your account first.')
window.location.href = '/login'
}
</script>
<PricingCard
@ -27,6 +32,7 @@
description="Epic elite! The Flounder's Edition is almost as good as the Founder's edition, and you'll help PocketHost go global."
{priceMonthly}
{priceAnnually}
requireAuthenticatedUser
checkoutMonthURL="https://store.pockethost.io/buy/9ff8775b-6b9e-4aa8-a0ab-dc5e58e25408?checkout[custom][user_id]={$userStore?.id}&checkout[email]={$userStore?.email}&checkout[discount_code]=G0MTI0OQ"
checkoutYearURL="https://store.pockethost.io/buy/82d79f7c-64f6-4c2b-9f58-dcc8951f1cdd?checkout[custom][user_id]={$userStore?.id}&checkout[email]={$userStore?.email}&checkout[discount_code]=G0MTI0OQ"
features={[

View File

@ -1,5 +1,6 @@
<script lang="ts">
import { faClock, faCheck, faTimes } from '@fortawesome/free-solid-svg-icons'
import { userStore } from '$util/stores'
import Fa from 'svelte-fa'
import { onMount, onDestroy } from 'svelte'
import { writable } from 'svelte/store'
@ -18,6 +19,7 @@
export let fundingGoals: string[] = []
export let startDate: Date | null = null
export let endDate: Date | null = null
export let requireAuthenticatedUser = false
const comingSoon = startDate && startDate > new Date()
@ -73,6 +75,9 @@
} else if (qtyRemaining <= 0) {
event.preventDefault()
alert(soldOutText)
} else if (requireAuthenticatedUser && !$userStore?.verified) {
event.preventDefault()
alert('Please create and verify your account first.')
}
}
</script>