diff options
| author | Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> | 2024-07-28 11:19:32 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-28 11:19:32 +0900 |
| commit | 61f4a03e6cd65af4a825f666acd31f4853c5bbad (patch) | |
| tree | 9d93946e415fff6e7c68a68b2ffcc6fb02c955e6 /packages/frontend/src/components | |
| parent | update deps (#14312) (diff) | |
| download | misskey-61f4a03e6cd65af4a825f666acd31f4853c5bbad.tar.gz misskey-61f4a03e6cd65af4a825f666acd31f4853c5bbad.tar.bz2 misskey-61f4a03e6cd65af4a825f666acd31f4853c5bbad.zip | |
Fix(frontend): 下書き/削除して編集で保持されない項目があった問題を修正 (#14285)
* chore(frontend): reorder assignments
* fix(frontend): visibleUserIds is not kept when deleteAndEdit
* fix(frontend): quoteId is not kept on draft
* fix(frontend): reactionAcceptance is not kept for draft/deleteAndEdit
* docs(changelog): update changelog
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index d057d197ec..64ad60ae85 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -367,6 +367,8 @@ function watchForDraft() { watch(files, () => saveDraft(), { deep: true }); watch(visibility, () => saveDraft()); watch(localOnly, () => saveDraft()); + watch(quoteId, () => saveDraft()); + watch(reactionAcceptance, () => saveDraft()); } function checkMissingMention() { @@ -703,6 +705,8 @@ function saveDraft() { files: files.value, poll: poll.value, visibleUserIds: visibility.value === 'specified' ? visibleUsers.value.map(x => x.id) : undefined, + quoteId: quoteId.value, + reactionAcceptance: reactionAcceptance.value, }, }; @@ -991,6 +995,8 @@ onMounted(() => { users.forEach(u => pushVisibleUser(u)); }); } + quoteId.value = draft.data.quoteId; + reactionAcceptance.value = draft.data.reactionAcceptance; } } @@ -998,9 +1004,11 @@ onMounted(() => { if (props.initialNote) { const init = props.initialNote; text.value = init.text ? init.text : ''; - files.value = init.files ?? []; - cw.value = init.cw ?? null; useCw.value = init.cw != null; + cw.value = init.cw ?? null; + visibility.value = init.visibility; + localOnly.value = init.localOnly ?? false; + files.value = init.files ?? []; if (init.poll) { poll.value = { choices: init.poll.choices.map(x => x.text), @@ -1009,9 +1017,13 @@ onMounted(() => { expiredAfter: null, }; } - visibility.value = init.visibility; - localOnly.value = init.localOnly ?? false; + if (init.visibleUserIds) { + misskeyApi('users/show', { userIds: init.visibleUserIds }).then(users => { + users.forEach(u => pushVisibleUser(u)); + }); + } quoteId.value = init.renote ? init.renote.id : null; + reactionAcceptance.value = init.reactionAcceptance; } nextTick(() => watchForDraft()); |