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
This commit is contained in:
Sayamame-beans 2024-07-28 11:19:32 +09:00 committed by GitHub
parent 085b3abf26
commit 61f4a03e6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 5 deletions

View file

@ -41,6 +41,9 @@
- Fix: リアクションしたユーザー一覧のユーザー名がはみ出る問題を修正 - Fix: リアクションしたユーザー一覧のユーザー名がはみ出る問題を修正
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/672) (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/672)
- Fix: `/share`ページにおいて絵文字ピッカーを開くことができない問題を修正 - Fix: `/share`ページにおいて絵文字ピッカーを開くことができない問題を修正
- Fix: ダイレクト投稿の"削除して編集"において、宛先が保持されていなかった問題を修正
- Fix: 投稿フォームへのURL貼り付けによる引用が下書きに保存されていなかった問題を修正
- Fix: "削除して編集"や下書きにおいて、リアクションの受け入れ設定が保持/保存されていなかった問題を修正
### Server ### Server
- Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949) - Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949)

View file

@ -204,6 +204,7 @@ export const packedNoteSchema = {
reactionAcceptance: { reactionAcceptance: {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,
enum: ['likeOnly', 'likeOnlyForRemote', 'nonSensitiveOnly', 'nonSensitiveOnlyForLocalLikeOnlyForRemote'],
}, },
reactionEmojis: { reactionEmojis: {
type: 'object', type: 'object',

View file

@ -367,6 +367,8 @@ function watchForDraft() {
watch(files, () => saveDraft(), { deep: true }); watch(files, () => saveDraft(), { deep: true });
watch(visibility, () => saveDraft()); watch(visibility, () => saveDraft());
watch(localOnly, () => saveDraft()); watch(localOnly, () => saveDraft());
watch(quoteId, () => saveDraft());
watch(reactionAcceptance, () => saveDraft());
} }
function checkMissingMention() { function checkMissingMention() {
@ -703,6 +705,8 @@ function saveDraft() {
files: files.value, files: files.value,
poll: poll.value, poll: poll.value,
visibleUserIds: visibility.value === 'specified' ? visibleUsers.value.map(x => x.id) : undefined, 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)); users.forEach(u => pushVisibleUser(u));
}); });
} }
quoteId.value = draft.data.quoteId;
reactionAcceptance.value = draft.data.reactionAcceptance;
} }
} }
@ -998,9 +1004,11 @@ onMounted(() => {
if (props.initialNote) { if (props.initialNote) {
const init = props.initialNote; const init = props.initialNote;
text.value = init.text ? init.text : ''; text.value = init.text ? init.text : '';
files.value = init.files ?? [];
cw.value = init.cw ?? null;
useCw.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) { if (init.poll) {
poll.value = { poll.value = {
choices: init.poll.choices.map(x => x.text), choices: init.poll.choices.map(x => x.text),
@ -1009,9 +1017,13 @@ onMounted(() => {
expiredAfter: null, expiredAfter: null,
}; };
} }
visibility.value = init.visibility; if (init.visibleUserIds) {
localOnly.value = init.localOnly ?? false; misskeyApi('users/show', { userIds: init.visibleUserIds }).then(users => {
users.forEach(u => pushVisibleUser(u));
});
}
quoteId.value = init.renote ? init.renote.id : null; quoteId.value = init.renote ? init.renote.id : null;
reactionAcceptance.value = init.reactionAcceptance;
} }
nextTick(() => watchForDraft()); nextTick(() => watchForDraft());

View file

@ -4089,7 +4089,8 @@ export type components = {
userId: string | null; userId: string | null;
}) | null; }) | null;
localOnly?: boolean; localOnly?: boolean;
reactionAcceptance: string | null; /** @enum {string|null} */
reactionAcceptance: 'likeOnly' | 'likeOnlyForRemote' | 'nonSensitiveOnly' | 'nonSensitiveOnlyForLocalLikeOnlyForRemote';
reactionEmojis: { reactionEmojis: {
[key: string]: string; [key: string]: string;
}; };