Safely handle legacy recordData that may not include the timestamp payload

This commit is contained in:
Nick Krecklow 2020-04-19 20:04:13 -05:00
parent 203d8df844
commit 61295d0600
No known key found for this signature in database
GPG Key ID: 5F149FDE156FFA94

@ -221,7 +221,7 @@ export class ServerRegistration {
const recordData = ping.recordData const recordData = ping.recordData
// Safely handle legacy recordData that may not include the timestamp payload // Safely handle legacy recordData that may not include the timestamp payload
if (recordData.timestamp !== -1) { if (recordData.timestamp > 0) {
recordValueElement.innerHTML = formatNumber(recordData.playerCount) + ' (' + formatDate(recordData.timestamp) + ')' recordValueElement.innerHTML = formatNumber(recordData.playerCount) + ' (' + formatDate(recordData.timestamp) + ')'
recordLabelElement.title = 'At ' + formatDate(recordData.timestamp) + ' ' + formatTimestamp(recordData.timestamp) recordLabelElement.title = 'At ' + formatDate(recordData.timestamp) + ' ' + formatTimestamp(recordData.timestamp)
} else { } else {