fix(frontend): クライアント上での時間ベースの実績獲得動作が実績獲得後も発動している問題を修正 (#14717)

* 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 <evan@geopjr.dev>
This commit is contained in:
かっこかり 2024-10-07 09:07:02 +09:00 committed by GitHub
parent a594d9f26b
commit d2f1d45ea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 11 deletions

View File

@ -21,6 +21,8 @@
### Client
- Enhance: デザインの調整
- Enhance: ログイン画面の認証フローを改善
- Fix: クライアント上での時間ベースの実績獲得動作が実績獲得後も発動していた問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/657)
### Server
- Enhance: セキュリティ向上のため、ログイン時にメール通知を行うように

View File

@ -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');