Check if time-based achievements are unlocked before initializing them in main-boot

This commit is contained in:
Evan Paterakis 2024-10-05 22:58:43 +03:00
parent ac1e5a0fb5
commit c0702fd92f
No known key found for this signature in database
GPG Key ID: FE5185F095BFC8C9
1 changed files with 17 additions and 11 deletions

View File

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