Add support for other attribute types in generic previews
This commit is contained in:
parent
d02095254a
commit
12d9228502
|
@ -64,13 +64,20 @@ for (const attribute of attributes) {
|
||||||
clippedAttributes.push(attribute);
|
clippedAttributes.push(attribute);
|
||||||
} else {
|
} else {
|
||||||
metaLength += getLocalizedMatch(attribute.translations).name.length;
|
metaLength += getLocalizedMatch(attribute.translations).name.length;
|
||||||
if (attribute.type === AttributeTypes.Tags) {
|
switch (attribute.type) {
|
||||||
metaLength += attribute.value
|
case AttributeTypes.Number:
|
||||||
.map(({ translations }) => getLocalizedMatch(translations).name)
|
metaLength += attribute.value.toString().length;
|
||||||
.join(", ").length;
|
break;
|
||||||
metaLength += clippedAttributes.push(attribute);
|
case AttributeTypes.Text:
|
||||||
|
metaLength += attribute.value.length;
|
||||||
|
break;
|
||||||
|
case AttributeTypes.Tags:
|
||||||
|
metaLength += attribute.value
|
||||||
|
.map(({ translations }) => getLocalizedMatch(translations).name)
|
||||||
|
.join(", ").length;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// TODO: Handle other attribute types
|
metaLength += clippedAttributes.push(attribute);
|
||||||
}
|
}
|
||||||
metaLength += 8;
|
metaLength += 8;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue