add some achievements
This commit is contained in:
parent
9d367882fb
commit
2b377a3dc5
5 changed files with 56 additions and 6 deletions
|
|
@ -8,11 +8,36 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { onActivated, onDeactivated, onMounted, onUnmounted, ref } from 'vue';
|
||||
import MkAchievements from '@/components/MkAchievements.vue';
|
||||
import { i18n } from '@/i18n';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { $i } from '@/account';
|
||||
import { claimAchievement } from '@/scripts/achievements';
|
||||
|
||||
let timer;
|
||||
|
||||
function viewAchievements3min() {
|
||||
claimAchievement('viewAchievements3min');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.clearTimeout(timer);
|
||||
timer = null;
|
||||
});
|
||||
|
||||
onActivated(() => {
|
||||
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
||||
});
|
||||
|
||||
onDeactivated(() => {
|
||||
window.clearTimeout(timer);
|
||||
timer = null;
|
||||
});
|
||||
|
||||
definePageMetadata({
|
||||
title: i18n.ts.achievements,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue