KDS: Fix station selection logic, add debug logging
This commit is contained in:
parent
4e4f3cf465
commit
108a90531e
1 changed files with 12 additions and 5 deletions
17
kds/kds.js
17
kds/kds.js
|
|
@ -70,21 +70,28 @@ function saveConfigToStorage() {
|
|||
|
||||
// Check if station selection is needed
|
||||
async function checkStationSelection() {
|
||||
if (!config.businessId) return;
|
||||
if (!config.businessId) {
|
||||
console.log('[KDS] No businessId, cannot start');
|
||||
return;
|
||||
}
|
||||
|
||||
// If station already selected, start KDS
|
||||
if (config.stationId !== null) {
|
||||
console.log('[KDS] Starting with businessId:', config.businessId, 'stationId:', config.stationId);
|
||||
|
||||
// If station already selected (including 0 for "all"), start KDS
|
||||
if (config.stationId !== null && config.stationId !== undefined) {
|
||||
updateStationBadge();
|
||||
startAutoRefresh();
|
||||
return;
|
||||
}
|
||||
|
||||
// Load stations and show selection
|
||||
// Load stations to see if we need to show picker
|
||||
await loadStations();
|
||||
if (stations.length > 0) {
|
||||
showStationSelection();
|
||||
} else {
|
||||
// No stations configured, just start with all orders
|
||||
// No stations configured, default to all orders
|
||||
config.stationId = 0;
|
||||
updateStationBadge();
|
||||
startAutoRefresh();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue