@@ -22,7 +22,8 @@ defineOptions({
2222const props = defineProps ({
2323 showState: String ,
2424 event : Object ,
25- prepaidBadgesLeft: Number
25+ prepaidBadgesLeft: Number ,
26+ currentEventBadgeCount: Number
2627});
2728
2829const currentTime = ref (dayjs ());
@@ -47,7 +48,7 @@ const prepaidBadgesLeft = computed(() => props.prepaidBadgesLeft || 0);
4748
4849const userBadgeOrderedCount = computed (() => {
4950 if (! user .value ) return null ;
50- return user . value . badges ? . length || 0 ;
51+ return props . currentEventBadgeCount || 0 ;
5152});
5253
5354const orderStatus = computed (() => {
@@ -100,7 +101,7 @@ const orderStatus = computed(() => {
100101const userBadgeStatus = computed (() => {
101102 if (! user .value ) return null ;
102103
103- const badgeCount = user . value . badges ? . length || 0 ;
104+ const badgeCount = props . currentEventBadgeCount || 0 ;
104105 const prepaidLeft = prepaidBadgesLeft .value ;
105106
106107 if (prepaidLeft > 0 ) {
@@ -174,7 +175,7 @@ const shouldShowRegMessage = computed(() => {
174175
175176 <!-- Secondary Action Button -->
176177 < Button
177- v- if = " user.badges?.length > 0"
178+ v- if = " currentEventBadgeCount > 0"
178179 @click= " router.visit(route('badges.index'))"
179180 icon= " pi pi-list"
180181 class = " flex-1 font-semibold"
@@ -199,7 +200,7 @@ const shouldShowRegMessage = computed(() => {
199200
200201 <!-- Secondary Action Button -->
201202 < Button
202- v- if = " user.badges?.length > 0"
203+ v- if = " currentEventBadgeCount > 0"
203204 @click= " router.visit(route('badges.index'))"
204205 icon= " pi pi-list"
205206 class = " flex-1 font-semibold"
@@ -225,10 +226,10 @@ const shouldShowRegMessage = computed(() => {
225226 < / div>
226227
227228 <!-- Status Info -->
228- < div v- if = " user.badges?.length > 0" class = " flex justify-center mt-6" >
229+ < div v- if = " currentEventBadgeCount > 0" class = " flex justify-center mt-6" >
229230 < div class = " bg-green-500/90 backdrop-blur-sm rounded-lg px-6 py-2 text-white shadow-lg" >
230231 < i class = " pi pi-check mr-2" >< / i>
231- {{ user . badges . length }} Badge{{ user . badges . length > 1 ? ' s' : ' ' }} Ordered
232+ {{ currentEventBadgeCount }} Badge{{ currentEventBadgeCount > 1 ? ' s' : ' ' }} Ordered
232233 < / div>
233234 < / div>
234235 < / div>
@@ -239,7 +240,7 @@ const shouldShowRegMessage = computed(() => {
239240 Login to customize your fursuit badge that you have bought with your ticket. Additional badges can be ordered at a fee from {{ dayjs(event.orderStartsAt).format(' D .M .YYYY ' ) }}.
240241 </p>
241242 <Link
242- v-if="user.badges?.length > 0"
243+ v-if="currentEventBadgeCount > 0"
243244 :href="route(' badges .index ' )"
244245 class="w-full">
245246 <Button
@@ -266,7 +267,7 @@ const shouldShowRegMessage = computed(() => {
266267 />
267268 </a>
268269 <Link
269- v-if="user.badges?.length > 0"
270+ v-if="currentEventBadgeCount > 0"
270271 :href="route(' badges .index ' )"
271272 class="w-full">
272273 <Button
@@ -283,7 +284,7 @@ const shouldShowRegMessage = computed(() => {
283284 <div v-else class="text-center space-y-6">
284285 <p class="text-2xl mb-6 opacity-90">Badge orders are currently closed</p>
285286 <Link
286- v-if="user.badges?.length > 0"
287+ v-if="currentEventBadgeCount > 0"
287288 :href="route(' badges .index ' )"
288289 class="w-full">
289290 <Button
0 commit comments