mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-09 03:33:09 +02:00
enhance(frontend): ユーザーメニューからユーザーメモを編集できるように
This commit is contained in:
parent
5cac1515fd
commit
e014c91899
2 changed files with 28 additions and 0 deletions
|
@ -994,6 +994,7 @@ accountMigration: "アカウントの引っ越し"
|
|||
accountMoved: "このユーザーは新しいアカウントに引っ越しました:"
|
||||
forceShowAds: "常に広告を表示する"
|
||||
addMemo: "メモを追加"
|
||||
editMemo: "メモを編集"
|
||||
|
||||
_accountMigration:
|
||||
moveTo: "このアカウントを新しいアカウントに引っ越す"
|
||||
|
|
|
@ -98,6 +98,27 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
|||
});
|
||||
}
|
||||
|
||||
async function editMemo(): Promise<void> {
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue