Skip to content

Commit 1de4a08

Browse files
authored
Merge pull request #2788 from JhChoy/patch-1
fix: topics formatting bug at composeState
2 parents 2b2f061 + f3baec5 commit 1de4a08

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)