diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-01-21 16:06:49 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-01-21 16:06:49 +0900 |
| commit | 2b377a3dc5f0beccf36d4b37237adb9c39e92652 (patch) | |
| tree | 5cd8782090f4e700c14d1ee26cb429db9acfa3d2 /packages/frontend/src/init.ts | |
| parent | add some achievements (diff) | |
| download | sharkey-2b377a3dc5f0beccf36d4b37237adb9c39e92652.tar.gz sharkey-2b377a3dc5f0beccf36d4b37237adb9c39e92652.tar.bz2 sharkey-2b377a3dc5f0beccf36d4b37237adb9c39e92652.zip | |
add some achievements
Diffstat (limited to 'packages/frontend/src/init.ts')
| -rw-r--r-- | packages/frontend/src/init.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/frontend/src/init.ts b/packages/frontend/src/init.ts index a2723d479c..09fb7caf14 100644 --- a/packages/frontend/src/init.ts +++ b/packages/frontend/src/init.ts @@ -346,10 +346,11 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements'; }); } + const now = new Date(); + const m = now.getMonth() + 1; + const d = now.getDate(); + if ($i.birthday) { - const now = new Date(); - const m = now.getMonth() + 1; - const d = now.getDate(); const bm = parseInt($i.birthday.split('-')[1]); const bd = parseInt($i.birthday.split('-')[2]); if (m === bm && d === bd) { @@ -357,6 +358,10 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements'; } } + if (m === 1 && d === 1) { + claimAchievement('loggedInOnNewYearsDay'); + } + if ($i.loggedInDays >= 3) claimAchievement('login3'); if ($i.loggedInDays >= 7) claimAchievement('login7'); if ($i.loggedInDays >= 15) claimAchievement('login15'); |