fix: use server code from webhook response for location select value
The stats webhook now returns a 'code' field (e.g. 'fr', 'usa') alongside the display 'server' name. The option value now uses s.code and falls back to slugified server name for backward compat.
This commit is contained in:
@@ -564,10 +564,11 @@
|
||||
}
|
||||
servers.forEach(function(s) {
|
||||
const server = s.server || '';
|
||||
const serverCode = s.code || server.toLowerCase().replace(/\s+/g, '-');
|
||||
const available = parseInt(s['Seats Available'], 10) || 0;
|
||||
const label = server.charAt(0).toUpperCase() + server.slice(1);
|
||||
const opt = document.createElement('option');
|
||||
opt.value = server.toLowerCase().replace(/\s+/g, '-');
|
||||
opt.value = serverCode;
|
||||
if (available <= 0) {
|
||||
opt.textContent = label + ' (sold out)';
|
||||
opt.disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user