|
@@ -7,9 +7,6 @@ export function pruneHistory (model) {
|
|
|
const max_history = api.settings.get('prune_messages_above');
|
|
|
if (max_history && typeof max_history === 'number') {
|
|
|
if (model.messages.length > max_history) {
|
|
|
-
|
|
|
- model.messages.sort(); // Explicitly call sort() to avoid race-conditions
|
|
|
-
|
|
|
const non_empty_messages = model.messages.filter((m) => !u.isEmptyMessage(m));
|
|
|
if (non_empty_messages.length > max_history) {
|
|
|
while (non_empty_messages.length > max_history) {
|