fix: align discord config ui

This commit is contained in:
Peter Steinberger
2026-01-02 21:15:59 +01:00
parent 4541bb2716
commit 118a6d7421
6 changed files with 303 additions and 205 deletions

View File

@@ -217,11 +217,16 @@ export async function saveDiscordConfig(state: ConnectionsState) {
delete discord.mediaMaxMb;
}
const historyLimit = Number(form.historyLimit);
if (Number.isFinite(historyLimit) && historyLimit >= 0) {
discord.historyLimit = historyLimit;
} else {
const historyLimitRaw = form.historyLimit.trim();
if (historyLimitRaw.length === 0) {
delete discord.historyLimit;
} else {
const historyLimit = Number(historyLimitRaw);
if (Number.isFinite(historyLimit) && historyLimit >= 0) {
discord.historyLimit = historyLimit;
} else {
delete discord.historyLimit;
}
}
if (form.enableReactions) {