Set the maximum number of backups via config

ce18b33e738e9daf632640a7442bb72d945d7f1a

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +3 -1Ignore whitespace
default/config.yaml+2 -0
@@ -48,6 +48,8 @@ allowKeysExposure: false
4848skipContentCheck: false
4949# Disable automatic chats backup
5050disableChatBackup: false
51+# Number of backups to keep for each chat and settings file
52+numberOfBackups: 50
5153# Allowed hosts for card downloads
5254whitelistImportDomains:
5355 - localhost
src/util.js+1 -1
@@ -371,7 +371,7 @@ function generateTimestamp() {
371371 * @param {string} prefix File prefix to filter backups by.
372372 */
373373function removeOldBackups(directory, prefix) {
374374 const MAX_BACKUPS = Number(getConfigValue('numberOfBackups', 50));
375375
376376 let files = fs.readdirSync(directory).filter(f => f.startsWith(prefix));
377377 if (files.length > MAX_BACKUPS) {