Skip to content

Commit 6bb21e9

Browse files
authored
fix: topics formatting bug at composeState
1 parent 0bab4d5 commit 6bb21e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/runtime.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1509,12 +1509,12 @@ Text: ${attachment.text}
15091509
this.character.topics
15101510
.sort(() => 0.5 - Math.random())
15111511
.slice(0, 5)
1512-
.map((topic, index) => {
1513-
if (index === this.character.topics.length - 2) {
1512+
.map((topic, index, array) => {
1513+
if (index === array.length - 2) {
15141514
return topic + " and ";
15151515
}
15161516
// if last topic, don't add a comma
1517-
if (index === this.character.topics.length - 1) {
1517+
if (index === array.length - 1) {
15181518
return topic;
15191519
}
15201520
return topic + ", ";

0 commit comments

Comments
 (0)