mirror of
https://github.com/flarum/core.git
synced 2025-07-26 03:01:22 +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) {
|
for (const i in this) {
|
||||||
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
|
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;
|
this[i].content.itemName = i;
|
||||||
items.push(this[i]);
|
items.push(this[i]);
|
||||||
this[i].key = items.length;
|
this[i].key = items.length;
|
||||||
|
Reference in New Issue
Block a user