Skip to content

Commit eb58d2e

Browse files
committed
Setup Badge Station
1 parent 553cb45 commit eb58d2e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/Common/BadgePrintPreview.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import StandardButton from '@/components/Common/StandardButton.vue'
44
import { useEventyayApi } from '@/stores/eventyayapi'
55
66
const processApi = useEventyayApi()
7-
const { apitoken, url, organizer, eventSlug, eventname } = processApi
7+
const { apitoken, url, organizer, eventSlug, eventname, selectedRole} = processApi
88
const props = defineProps({
99
url: {
1010
type: String,
@@ -40,6 +40,12 @@ const fetchPDF = async () => {
4040
pdfBlob.value = await response.blob()
4141
pdfUrl.value = URL.createObjectURL(pdfBlob.value)
4242
isLoading.value = false
43+
if (selectedRole=="Badge Station") {
44+
handlePrint()
45+
setTimeout(() => {
46+
emit('close')
47+
}, 5000)
48+
}
4349
} catch (error) {
4450
console.error('Error fetching PDF:', error)
4551
printError.value = true
@@ -106,7 +112,6 @@ const handlePrint = () => {
106112
// Try silent print first
107113
printStrategies.silentPrint()
108114
}
109-
110115
// Download handler
111116
const handleDownload = () => {
112117
if (!pdfBlob.value) return

src/components/Eventyay/EventyayEventCheckIn.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { message, showSuccess, showError, badgeUrl, isGeneratingBadge } = storeTo
1616
processEventyayCheckInStore
1717
)
1818
const processApi = useEventyayApi()
19-
const { apitoken, url, organizer, eventSlug, eventname } = processApi
19+
const { apitoken, url, organizer, eventSlug, eventname,selectedRole } = processApi
2020
const countdown = ref(5)
2121
const timerInstance = ref(null)
2222
const timeoutInstance = ref(null)
@@ -87,6 +87,7 @@ watch([showSuccess, showError], ([newSuccess, newError], [oldSuccess, oldError])
8787
function showPopup() {
8888
notes.value = ''
8989
startCountdown()
90+
if (selectedRole=="Badge Station") {handlePrint()}
9091
timeoutInstance.value = setTimeout(() => {
9192
processEventyayCheckInStore.$reset()
9293
}, 10000)

0 commit comments

Comments
 (0)