summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPostForm.vue
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-04-16 13:37:14 +0900
committerGitHub <noreply@github.com>2024-04-16 13:37:14 +0900
commite9e877f64e83bf34f90373a366567b852d3cce18 (patch)
tree157671a33861510437afd14764e951e18e30f853 /packages/frontend/src/components/MkPostForm.vue
parentci: Check Misskey JS autogenを様々改善 (#13718) (diff)
downloadmisskey-e9e877f64e83bf34f90373a366567b852d3cce18.tar.gz
misskey-e9e877f64e83bf34f90373a366567b852d3cce18.tar.bz2
misskey-e9e877f64e83bf34f90373a366567b852d3cce18.zip
fix: ダイレクト投稿の宛先が保存されない (#13717)
* fix: ダイレクト投稿の宛先が保存されない * fix: 同じユーザーが複数回宛先に追加できる問題 * fix: 関係ないユーザーが宛先に追加される可能性がある
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
-rw-r--r--packages/frontend/src/components/MkPostForm.vue12
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index 014b866fbd..d7efca9de9 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -388,7 +388,7 @@ function addMissingMention() {
for (const x of extractMentions(ast)) {
if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
misskeyApi('users/show', { username: x.username, host: x.host }).then(user => {
- visibleUsers.value.push(user);
+ pushVisibleUser(user);
});
}
}
@@ -679,6 +679,7 @@ function saveDraft() {
localOnly: localOnly.value,
files: files.value,
poll: poll.value,
+ visibleUserIds: visibility.value === 'specified' ? visibleUsers.value.map(x => x.id) : undefined,
},
};
@@ -960,6 +961,15 @@ onMounted(() => {
if (draft.data.poll) {
poll.value = draft.data.poll;
}
+ if (draft.data.visibleUserIds) {
+ misskeyApi('users/show', { userIds: draft.data.visibleUserIds }).then(users => {
+ for (let i = 0; i < users.length; i++) {
+ if (users[i].id === draft.data.visibleUserIds[i]) {
+ pushVisibleUser(users[i]);
+ }
+ }
+ });
+ }
}
}