From 40debf20d866836a94d963dd041f946c3af4a8f4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 20 Apr 2023 19:40:02 +0900 Subject: [PATCH] add new achievement --- CHANGELOG.md | 1 + locales/ja-JP.yml | 3 +++ packages/backend/src/core/AchievementService.ts | 1 + packages/frontend/src/init.ts | 4 ++++ packages/frontend/src/scripts/achievements.ts | 6 ++++++ 5 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89a8cc3ee..a6fd30952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ * 画像が全て隠れた状態で表示されるようになります - 1枚だけのメディアリストの画像のアスペクト比を画像に応じて縦長にするように - Fix: リアクションをホバーした時のユーザーリストで猫耳が切れてしまっていた問題を修正 +- 新しい実績を追加 ### Server - Fix: エクスポートデータの拡張子がunknownになる問題を修正 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 8c1334c6a..6f6f49ab2 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1199,6 +1199,9 @@ _achievements: _client30min: title: "ひとやすみ" description: "クライアントを起動してから30分以上経過した" + _client60min: + title: "Misskeyの見すぎ" + description: "クライアントを起動してから60分以上経過した" _noteDeletedWithin1min: title: "いまのなし" description: "投稿してから1分以内にその投稿を削除した" diff --git a/packages/backend/src/core/AchievementService.ts b/packages/backend/src/core/AchievementService.ts index 1ca38d8bb..9e223f149 100644 --- a/packages/backend/src/core/AchievementService.ts +++ b/packages/backend/src/core/AchievementService.ts @@ -64,6 +64,7 @@ export const ACHIEVEMENT_TYPES = [ 'iLoveMisskey', 'foundTreasure', 'client30min', + 'client60min', 'noteDeletedWithin1min', 'postedAtLateNight', 'postedAt0min0sec', diff --git a/packages/frontend/src/init.ts b/packages/frontend/src/init.ts index 91cdc15ef..d40b76132 100644 --- a/packages/frontend/src/init.ts +++ b/packages/frontend/src/init.ts @@ -431,6 +431,10 @@ if ($i) { claimAchievement('client30min'); }, 1000 * 60 * 30); + window.setTimeout(() => { + claimAchievement('client60min'); + }, 1000 * 60 * 60); + const lastUsed = miLocalStorage.getItem('lastUsed'); if (lastUsed) { const lastUsedDate = parseInt(lastUsed, 10); diff --git a/packages/frontend/src/scripts/achievements.ts b/packages/frontend/src/scripts/achievements.ts index 25e8b71a1..f1da8a76d 100644 --- a/packages/frontend/src/scripts/achievements.ts +++ b/packages/frontend/src/scripts/achievements.ts @@ -60,6 +60,7 @@ export const ACHIEVEMENT_TYPES = [ 'iLoveMisskey', 'foundTreasure', 'client30min', + 'client60min', 'noteDeletedWithin1min', 'postedAtLateNight', 'postedAt0min0sec', @@ -343,6 +344,11 @@ export const ACHIEVEMENT_BADGES = { bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))', frame: 'bronze', }, + 'client60min': { + img: '/fluent-emoji/1f552.png', + bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))', + frame: 'silver', + }, 'noteDeletedWithin1min': { img: '/fluent-emoji/1f5d1.png', bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',