Update userStats.js
This commit is contained in:
@@ -336,8 +336,11 @@ export function renderUserStats() {
|
|||||||
for (const fieldName of config.statusSection.customFields) {
|
for (const fieldName of config.statusSection.customFields) {
|
||||||
const fieldKey = fieldName.toLowerCase();
|
const fieldKey = fieldName.toLowerCase();
|
||||||
let fieldValue = stats[fieldKey] || 'None';
|
let fieldValue = stats[fieldKey] || 'None';
|
||||||
|
// Handle array format (from JSON)
|
||||||
|
if (Array.isArray(fieldValue)) {
|
||||||
|
fieldValue = fieldValue.join(', ') || 'None';
|
||||||
|
} else if (typeof fieldValue === 'string') {
|
||||||
// Strip brackets if present (from JSON array format)
|
// Strip brackets if present (from JSON array format)
|
||||||
if (typeof fieldValue === 'string') {
|
|
||||||
fieldValue = fieldValue.replace(/^\[|\]$/g, '').trim();
|
fieldValue = fieldValue.replace(/^\[|\]$/g, '').trim();
|
||||||
}
|
}
|
||||||
html += `<div class="rpg-mood-conditions rpg-editable" contenteditable="true" data-field="${fieldKey}" title="Click to edit ${fieldName}">${fieldValue}</div>`;
|
html += `<div class="rpg-mood-conditions rpg-editable" contenteditable="true" data-field="${fieldKey}" title="Click to edit ${fieldName}">${fieldValue}</div>`;
|
||||||
|
|||||||
Reference in New Issue
Block a user