small fix
This commit is contained in:
@@ -11,9 +11,14 @@ window.renderLog = function(cmds) {
|
||||
|
||||
const rows = cmds.map(cmd => {
|
||||
const p = typeof cmd.payload === 'string' ? JSON.parse(cmd.payload) : cmd.payload;
|
||||
const desc = cmd.type === 'build'
|
||||
? `Build: ${p.building_id}`
|
||||
: `Recruit: ${p.amount}x ${p.unit_id}`;
|
||||
let desc = '';
|
||||
if (cmd.type === 'build') {
|
||||
desc = `Build: ${p.building_id}`;
|
||||
} else if (cmd.type === 'recruit') {
|
||||
desc = `Recruit: ${p.amount}x ${p.unit_id}`;
|
||||
} else if (cmd.type === 'market_offer') {
|
||||
desc = `Market: ${p.offer} ${p.offer_type} ➞ ${p.demand} ${p.demand_type}`;
|
||||
}
|
||||
const statusClass = `status-${cmd.status}`;
|
||||
const cancelBtn = `<button class="btn btn-danger btn-sm" onclick="cancelCommand(${cmd.id})">✕</button>`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user