fix
This commit is contained in:
@@ -565,6 +565,8 @@
|
||||
if (!pendingCmd) return;
|
||||
document.getElementById('btn-confirm').disabled = true;
|
||||
|
||||
// Capture before closeModal() nulls pendingCmd
|
||||
const { townId, townName, celType } = pendingCmd;
|
||||
try {
|
||||
const r = await fetch('/dashboard/culture-command', {
|
||||
method: 'POST',
|
||||
@@ -572,15 +574,15 @@
|
||||
body: JSON.stringify({
|
||||
player_id: PLAYER_ID,
|
||||
world_id: WORLD_ID,
|
||||
town_id: pendingCmd.townId,
|
||||
town_name: pendingCmd.townName,
|
||||
celebration_type: pendingCmd.celType
|
||||
town_id: townId,
|
||||
town_name: townName,
|
||||
celebration_type: celType
|
||||
})
|
||||
});
|
||||
const d = await r.json();
|
||||
closeModal();
|
||||
if (r.ok && d.ok) {
|
||||
showToast(`✅ Εντολή στάλθηκε — ${TYPE_LABELS[pendingCmd.celType]}`, 'ok');
|
||||
showToast(`✅ Εντολή στάλθηκε — ${TYPE_LABELS[celType]}`, 'ok');
|
||||
fetchLog();
|
||||
setTimeout(fetchAgora, 3000);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user