From d2f1d45ea36f16432a4b9df771bf974bbe7ef416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:07:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E3=82=AF=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=83=88=E4=B8=8A=E3=81=A7=E3=81=AE=E6=99=82?= =?UTF-8?q?=E9=96=93=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E5=AE=9F=E7=B8=BE?= =?UTF-8?q?=E7=8D=B2=E5=BE=97=E5=8B=95=E4=BD=9C=E3=81=8C=E5=AE=9F=E7=B8=BE?= =?UTF-8?q?=E7=8D=B2=E5=BE=97=E5=BE=8C=E3=82=82=E7=99=BA=E5=8B=95=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#14717)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Check if time-based achievements are unlocked before initializing them in main-boot (cherry picked from commit c0702fd92f70782005517c0065048ececa1ef287) * Update Changelog --------- Co-authored-by: Evan Paterakis --- CHANGELOG.md | 2 ++ packages/frontend/src/boot/main-boot.ts | 28 +++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85f5da28dd..405ee7c10a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ ### Client - Enhance: デザインの調整 - Enhance: ログイン画面の認証フローを改善 +- Fix: クライアント上での時間ベースの実績獲得動作が実績獲得後も発動していた問題を修正 + (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/657) ### Server - Enhance: セキュリティ向上のため、ログイン時にメール通知を行うように diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index ddd47ca448..76459ab330 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -230,19 +230,25 @@ export async function mainBoot() { claimAchievement('collectAchievements30'); } - window.setInterval(() => { - if (Math.floor(Math.random() * 20000) === 0) { - claimAchievement('justPlainLucky'); - } - }, 1000 * 10); + if (!claimedAchievements.includes('justPlainLucky')) { + window.setInterval(() => { + if (Math.floor(Math.random() * 20000) === 0) { + claimAchievement('justPlainLucky'); + } + }, 1000 * 10); + } - window.setTimeout(() => { - claimAchievement('client30min'); - }, 1000 * 60 * 30); + if (!claimedAchievements.includes('client30min')) { + window.setTimeout(() => { + claimAchievement('client30min'); + }, 1000 * 60 * 30); + } - window.setTimeout(() => { - claimAchievement('client60min'); - }, 1000 * 60 * 60); + if (!claimedAchievements.includes('client60min')) { + window.setTimeout(() => { + claimAchievement('client60min'); + }, 1000 * 60 * 60); + } // 邪魔 //const lastUsed = miLocalStorage.getItem('lastUsed');