sw.tsで/sw/shareが叩かれたら必ずshare-url-tempを初期化する

This commit is contained in:
tamaina 2025-07-26 02:46:06 +09:00
parent 6c61ef8861
commit 8b36fde37e
1 changed files with 5 additions and 3 deletions

View File

@ -48,6 +48,8 @@ globalThis.addEventListener('fetch', ev => {
responseUrl.pathname = '/share';
const formData = await ev.request.formData();
// とりあえず初期化 (IndexedDBの削除は時間がかかる可能性があるため空の配列をセット)
await set('share-url-temp', []);
if (formData.has('files')) {
const files = formData.getAll('files');
if (files.length > 0 && files.every(file => file instanceof Blob)) {