diff --git a/public/sw.js b/public/sw.js index aa41d0e..57b7c1c 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,5 +1,5 @@ -// Everclone PWA Service Worker (v2.0.0) -const CACHE_NAME = 'everclone-cache-v3'; +// Everclone PWA Service Worker (v2.1.0) +const CACHE_NAME = 'everclone-cache-v4'; const STATIC_ASSETS = [ '/', '/manifest.json', diff --git a/src/app/api/hooks/note/route.ts b/src/app/api/hooks/note/route.ts index f349dba..eedc05f 100644 --- a/src/app/api/hooks/note/route.ts +++ b/src/app/api/hooks/note/route.ts @@ -109,10 +109,14 @@ export async function POST(req: NextRequest) { .map((t) => t.trim()) .filter(Boolean); } - const files = formData.getAll('files') as File[]; - const single = formData.get('file') as File | null; - if (single && files.length === 0) files.push(single); - uploadedFiles.push(...files); + for (const [key, value] of formData.entries()) { + if (value && typeof value === 'object' && 'arrayBuffer' in value) { + const file = value as File; + if (file.size > 0) { + uploadedFiles.push(file); + } + } + } } // Check if Android shared a URL inside the `text`, `content`, or `title` diff --git a/src/app/share/route.ts b/src/app/share/route.ts index dca6cbb..dcf4867 100644 --- a/src/app/share/route.ts +++ b/src/app/share/route.ts @@ -169,13 +169,9 @@ export async function POST(req: NextRequest) { ).trim(); url = ((formData.get('url') as string) || '').trim(); - const rawFiles = [ - ...formData.getAll('files'), - ...formData.getAll('file'), - ]; - for (const item of rawFiles) { - if (item && typeof item === 'object' && 'arrayBuffer' in item) { - const file = item as File; + for (const [key, value] of formData.entries()) { + if (value && typeof value === 'object' && 'arrayBuffer' in value) { + const file = value as File; if (file.size > 0) { uploadedFiles.push(file); }