From 5a6024b1f55a04d292feb4c0c3f001482ec6ca6e Mon Sep 17 00:00:00 2001 From: Qian23333 <119576779+Qian23333@users.noreply.github.com> Date: Sat, 16 Aug 2025 17:03:27 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/remind.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/remind.js b/apps/remind.js index bc0eaba..52677b8 100644 --- a/apps/remind.js +++ b/apps/remind.js @@ -255,16 +255,17 @@ export class Remind extends ZZZPlugin { return messages; } + const defaultConfig = settings.getConfig('remind'); // 检查式舆防卫战 try { const abyssRawData = await api.getFinalData('zzzChallenge', { deviceFp }); if (!abyssRawData || !abyssRawData.has_data) { messages.push('式舆防卫战S评级: 0/7'); } else { - const userThreshold = userConfig.abyssCheckLevel || 7; + const abyssCheckLevel = userConfig.abyssCheckLevel ?? defaultConfig.abyssCheckLevel; const sCount = getSRankCountUpTo(abyssRawData.all_floor_detail, 7); - const status = sCount >= userThreshold ? ' ✓' : ''; - if (showAll || sCount < userThreshold) { + const status = sCount >= abyssCheckLevel ? ' ✓' : ''; + if (showAll || sCount < abyssCheckLevel) { messages.push(`式舆防卫战S评级: ${sCount}/7${status}`); } } @@ -279,9 +280,10 @@ export class Remind extends ZZZPlugin { if (!deadlyRawData || !deadlyRawData.has_data) { messages.push('危局强袭战星星: 0/9'); } else { + const deadlyStars = userConfig.deadlyStars ?? defaultConfig.deadlyStars; const totalStar = deadlyRawData.total_star || 0; - if (showAll || totalStar < userConfig.deadlyStars) { - const status = totalStar >= userConfig.deadlyStars ? ' ✓' : ''; + const status = totalStar >= deadlyStars ? ' ✓' : ''; + if (showAll || totalStar < deadlyStars) { messages.push(`危局强袭战星星: ${totalStar}/9${status}`); } }