203
return;
204
}
206
>
this._history = this.chatWidgetHistoryService.getHistory(this.location, this._historyKey);
207
>
const newLength = this._history.length;
208
>
209
>
// If this append operation adjusted all history entries back, move our index back too
210
>
// if we weren't pointing to the end of the history.
211
>
if (prevLength === newLength) {
212
this._overlay.shift();
213
if (this._currentIndex < this._history.length) {
214
this._currentIndex = Math.max(this._currentIndex - 1, 0);
215
}
217
>
this._currentIndex = newLength;
218
>
}
219
} else if (e.kind === 'clear') {
220
this._history = [];