feat(badges): auto-navigate to badge search after print

This commit is contained in:
Scott Idem
2026-02-26 17:36:45 -05:00
parent d1ded2d45e
commit 5a16772639
2 changed files with 6 additions and 12 deletions

View File

@@ -23,6 +23,7 @@
// *** Import Svelte specific
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
// *** Import other supporting libraries
// import { liveQuery } from 'dexie';
@@ -508,10 +509,10 @@
print_status = 'done';
console.log(`Badge printed. Count: ${data_to_update.print_count}`);
// Reset status after 2 seconds
// Brief success flash, then return to badge search
setTimeout(() => {
print_status = 'idle';
}, 2000);
goto(`/events/${event_id}/badges`);
}, 1000);
} catch (error) {
console.error('Error printing badge:', error);
print_status = 'error';