diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 83186dc72..5f5bcfd87 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -994,6 +994,7 @@ accountMigration: "アカウントの引っ越し" accountMoved: "このユーザーは新しいアカウントに引っ越しました:" forceShowAds: "常に広告を表示する" addMemo: "メモを追加" +editMemo: "メモを編集" _accountMigration: moveTo: "このアカウントを新しいアカウントに引っ越す" diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index fe941c77b..6ff9fb63f 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -98,6 +98,27 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router }); } + async function editMemo(): Promise { + const userDetailed = await os.api('users/show', { + userId: user.id, + }); + const { canceled, result } = await os.form(i18n.ts.editMemo, { + memo: { + type: 'string', + required: true, + multiline: true, + label: i18n.ts.memo, + default: userDetailed.memo, + }, + }); + if (canceled) return; + + os.apiWithDialog('users/update-memo', { + memo: result.memo, + userId: user.id, + }); + } + let menu = [{ icon: 'ti ti-at', text: i18n.ts.copyUsername, @@ -123,6 +144,12 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router os.post({ specified: user, initialText: `@${user.username} ` }); }, }, null, { + icon: 'ti ti-pencil', + text: i18n.ts.editMemo, + action: () => { + editMemo(); + }, + }, { type: 'parent', icon: 'ti ti-list', text: i18n.ts.addToList,