mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 08:13:10 +02:00
c2370a1be6
* chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
59 lines
1.3 KiB
Vue
59 lines
1.3 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<MkStickyContainer>
|
|
<template #header><MkPageHeader/></template>
|
|
<MkSpacer :contentMax="1200">
|
|
<MkAchievements :user="$i"/>
|
|
</MkSpacer>
|
|
</MkStickyContainer>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { onActivated, onDeactivated, onMounted, onUnmounted } 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: number | null;
|
|
|
|
function viewAchievements3min() {
|
|
claimAchievement('viewAchievements3min');
|
|
}
|
|
|
|
onMounted(() => {
|
|
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
|
});
|
|
|
|
onUnmounted(() => {
|
|
if (timer != null) {
|
|
window.clearTimeout(timer);
|
|
timer = null;
|
|
}
|
|
});
|
|
|
|
onActivated(() => {
|
|
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
|
});
|
|
|
|
onDeactivated(() => {
|
|
if (timer != null) {
|
|
window.clearTimeout(timer);
|
|
timer = null;
|
|
}
|
|
});
|
|
|
|
definePageMetadata({
|
|
title: i18n.ts.achievements,
|
|
icon: 'ti ti-medal',
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
|
|
</style>
|