Move trigger out of while loop
This commit is contained in:
parent
42b15497fc
commit
bb60f8cff4
@ -11,6 +11,7 @@ export function pruneHistory (model) {
|
|||||||
if (non_empty_messages.length > max_history) {
|
if (non_empty_messages.length > max_history) {
|
||||||
while (non_empty_messages.length > max_history) {
|
while (non_empty_messages.length > max_history) {
|
||||||
non_empty_messages.shift().destroy();
|
non_empty_messages.shift().destroy();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Triggered once the message history has been pruned, i.e.
|
* Triggered once the message history has been pruned, i.e.
|
||||||
* once older messages have been removed to keep the
|
* once older messages have been removed to keep the
|
||||||
@ -24,6 +25,5 @@ export function pruneHistory (model) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export const debouncedPruneHistory = debounce(pruneHistory, 250);
|
export const debouncedPruneHistory = debounce(pruneHistory, 250);
|
||||||
|
Loading…
Reference in New Issue
Block a user