mirror of
https://github.com/flarum/core.git
synced 2025-07-25 10:41:24 +02:00
Allow string primitives to be added to ItemLists
This commit is contained in:
@@ -50,6 +50,10 @@ export default class ItemList {
|
||||
|
||||
for (const i in this) {
|
||||
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
|
||||
if (typeof this[i].content === 'string') {
|
||||
this[i].content = new String(this[i].content);
|
||||
}
|
||||
|
||||
this[i].content.itemName = i;
|
||||
items.push(this[i]);
|
||||
this[i].key = items.length;
|
||||
|
Reference in New Issue
Block a user