summaryrefslogtreecommitdiff
path: root/packages/frontend/src/boot
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-10-07 09:07:02 +0900
committerGitHub <noreply@github.com>2024-10-07 09:07:02 +0900
commitd2f1d45ea36f16432a4b9df771bf974bbe7ef416 (patch)
tree906e28b83a500bca80e44c576d0e753b49b62071 /packages/frontend/src/boot
parentmake animatedMfm enable by default (diff)
downloadsharkey-d2f1d45ea36f16432a4b9df771bf974bbe7ef416.tar.gz
sharkey-d2f1d45ea36f16432a4b9df771bf974bbe7ef416.tar.bz2
sharkey-d2f1d45ea36f16432a4b9df771bf974bbe7ef416.zip
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>
Diffstat (limited to 'packages/frontend/src/boot')
-rw-r--r--packages/frontend/src/boot/main-boot.ts28
1 files changed, 17 insertions, 11 deletions
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');