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

View File

@ -230,19 +230,25 @@ export async function mainBoot() {
claimAchievement('collectAchievements30'); claimAchievement('collectAchievements30');
} }
if (!claimedAchievements.includes('justPlainLucky')) {
window.setInterval(() => { window.setInterval(() => {
if (Math.floor(Math.random() * 20000) === 0) { if (Math.floor(Math.random() * 20000) === 0) {
claimAchievement('justPlainLucky'); claimAchievement('justPlainLucky');
} }
}, 1000 * 10); }, 1000 * 10);
}
if (!claimedAchievements.includes('client30min')) {
window.setTimeout(() => { window.setTimeout(() => {
claimAchievement('client30min'); claimAchievement('client30min');
}, 1000 * 60 * 30); }, 1000 * 60 * 30);
}
if (!claimedAchievements.includes('client60min')) {
window.setTimeout(() => { window.setTimeout(() => {
claimAchievement('client60min'); claimAchievement('client60min');
}, 1000 * 60 * 60); }, 1000 * 60 * 60);
}
// 邪魔 // 邪魔
//const lastUsed = miLocalStorage.getItem('lastUsed'); //const lastUsed = miLocalStorage.getItem('lastUsed');