-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(frontend): 下書き/削除して編集で保持されない項目があった問題を修正 #14285
Changes from all commits
eed098e
104fa50
6cda548
75a2c89
29a3d44
758be99
a8722db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,16 +995,20 @@ onMounted(() => { | |
users.forEach(u => pushVisibleUser(u)); | ||
}); | ||
} | ||
quoteId.value = draft.data.quoteId; | ||
reactionAcceptance.value = draft.data.reactionAcceptance; | ||
} | ||
} | ||
|
||
// 削除して編集 | ||
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (なお、あったとしてもrenoteIdの方が優先されるように書かれていたはずなので、問題は起きていません) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #14476 より、逆にrenoteIdを外した方が良さそうですね There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #14476 は×ボタンで解除したにもかかわらず解除できていないのを問題とする内容なので、renoteId/quoteIdの話ではないかも… There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. いえ、その×ボタンはquoteIdで発生するやつなので… |
||
reactionAcceptance.value = init.reactionAcceptance; | ||
} | ||
|
||
nextTick(() => watchForDraft()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ややこしいんですがここに
null
を加えないと自動生成の型が nullable でなくなってしまいますThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullableだけじゃ不足なのですね…なるほど