don't add duplicates of last remembered string in chat history
This commit is contained in:
parent
a1638dde48
commit
0b811c70fd
1 changed files with 7 additions and 0 deletions
|
|
@ -133,6 +133,13 @@ export class ChatInputComponent extends Component {
|
|||
}
|
||||
|
||||
public remember(text: string) {
|
||||
// don't add duplicates of last remembered string
|
||||
if (this.history.length > 0 && text === this.history[this.history.length-1]) {
|
||||
this.historyIndex = this.history.length;
|
||||
config.set("chat.history.index", this.historyIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.history.length > 100) {
|
||||
this.history.shift();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue