Skip to content

Commit

Permalink
Merge pull request #2788 from JhChoy/patch-1
Browse files Browse the repository at this point in the history
fix: topics formatting bug at composeState
  • Loading branch information
shakkernerd authored Jan 25, 2025
2 parents 2b2f061 + f3baec5 commit 1de4a08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1509,12 +1509,12 @@ Text: ${attachment.text}
this.character.topics
.sort(() => 0.5 - Math.random())
.slice(0, 5)
.map((topic, index) => {
if (index === this.character.topics.length - 2) {
.map((topic, index, array) => {
if (index === array.length - 2) {
return topic + " and ";
}
// if last topic, don't add a comma
if (index === this.character.topics.length - 1) {
if (index === array.length - 1) {
return topic;
}
return topic + ", ";
Expand Down

0 comments on commit 1de4a08

Please sign in to comment.