feat(badges): auto-navigate to badge search after print
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user