fix(frontend): ノートの下書きをリセットする際、未アップロードのファイルについては添付予定が解除されない問題を修正 (#17568)

* fix(frontend): ノートの下書きをリセットする際、未アップロードのファイルについては添付予定が解除されない問題を修正(#17486)

* fix(frontend): useUploader側にresetメソッドを追加し、そちらを呼び出す形に修正

* 現在のdisposeをresetにリネームして`items.value = [];`を追加する形に修正

* tweak

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
Tatsuya_yd 2026-06-17 14:26:45 +09:00 committed by GitHub
commit e117456815
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -18,6 +18,7 @@
- Fix: 「D」キーでダークモードを切り替える際にsyncDeviceDarkModeのチェックがバイパスされる問題を修正
- Fix: パスキー登録完了時の認証ダイアログの入力値が使われていない問題を修正
- Fix: メンションのサジェスト時に表示されるアイコン表示が画像サイズ次第で崩れる問題を修正
- Fix: ノートの下書きをリセットする際、未アップロードのファイルについては添付予定が解除されない問題を修正
- Fix: 画像アップロード時、フレームのキャプション付与が正しく行われないことがある問題を修正
### Server

View file

@ -719,6 +719,7 @@ function clear() {
poll.value = null;
quoteId.value = null;
scheduledAt.value = null;
uploader.reset();
}
function onKeydown(ev: KeyboardEvent) {

View file

@ -759,12 +759,17 @@ export function useUploader(options: {
item.preprocessedFile = markRaw(preprocessedFile);
}
function dispose() {
function reset() {
for (const item of items.value) {
if (item.thumbnail != null) URL.revokeObjectURL(item.thumbnail);
}
abortAll();
items.value = [];
}
function dispose() {
reset();
}
onUnmounted(() => {
@ -776,6 +781,7 @@ export function useUploader(options: {
addFiles,
removeItem,
abortAll,
reset,
dispose,
upload,
getMenu,