Respect # limit for ephemeral stop strings

This commit is contained in:
Cohee
2023-11-24 00:54:23 +02:00
parent 863554fea6
commit c4e1fff1bc
2 changed files with 9 additions and 7 deletions

View File

@ -2421,11 +2421,6 @@ export function getCustomStoppingStrings(limit = undefined) {
strings = strings.map(x => substituteParams(x));
}
// Apply the limit. If limit is 0, return all strings.
if (limit > 0) {
strings = strings.slice(0, limit);
}
return strings;
} catch (error) {
// If there's an error, return an empty array
@ -2436,7 +2431,14 @@ export function getCustomStoppingStrings(limit = undefined) {
const permanent = getPermanent();
const ephemeral = EPHEMERAL_STOPPING_STRINGS;
return [...permanent, ...ephemeral];
const strings = [...permanent, ...ephemeral];
// Apply the limit. If limit is 0, return all strings.
if (limit > 0) {
return strings.slice(0, limit);
}
return strings;
}
$(document).ready(() => {