merge: Check if time-based achievements are unlocked before initializing them in main-boot (!657)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/657 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
f77eb34225
@ -216,19 +216,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');
|
||||||
|
Loading…
Reference in New Issue
Block a user