summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkFollowButton.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-01-21 13:14:55 +0900
committerGitHub <noreply@github.com>2023-01-21 13:14:55 +0900
commit65cd605b739ae0d213b3502308e9cd523d3e1ae7 (patch)
treefe446502a4af681db8319703a6b3c14c2c8e990e /packages/frontend/src/components/MkFollowButton.vue
parentadd commands for build with swc (diff)
downloadmisskey-65cd605b739ae0d213b3502308e9cd523d3e1ae7.tar.gz
misskey-65cd605b739ae0d213b3502308e9cd523d3e1ae7.tar.bz2
misskey-65cd605b739ae0d213b3502308e9cd523d3e1ae7.zip
Achievements (#9665)
* wip * Update ja-JP.yml * wip * wip * Update MkAchievements.vue * wip * :art: * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'packages/frontend/src/components/MkFollowButton.vue')
-rw-r--r--packages/frontend/src/components/MkFollowButton.vue17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue
index ee256d9263..de8db54bfa 100644
--- a/packages/frontend/src/components/MkFollowButton.vue
+++ b/packages/frontend/src/components/MkFollowButton.vue
@@ -35,6 +35,8 @@ import * as Misskey from 'misskey-js';
import * as os from '@/os';
import { stream } from '@/stream';
import { i18n } from '@/i18n';
+import { claimAchievement } from '@/scripts/achievements';
+import { $i } from '@/account';
const props = withDefaults(defineProps<{
user: Misskey.entities.UserDetailed,
@@ -90,6 +92,21 @@ async function onClick() {
userId: props.user.id,
});
hasPendingFollowRequestFromYou = true;
+
+ claimAchievement('following1');
+
+ if ($i.followingCount >= 10) {
+ claimAchievement('following10');
+ }
+ if ($i.followingCount >= 50) {
+ claimAchievement('following50');
+ }
+ if ($i.followingCount >= 100) {
+ claimAchievement('following100');
+ }
+ if ($i.followingCount >= 300) {
+ claimAchievement('following300');
+ }
}
}
} catch (err) {