From e501ca0af1247803011e34dc8fe50359f1821950 Mon Sep 17 00:00:00 2001 From: Sead Feng Date: Tue, 27 Aug 2024 18:53:42 +0800 Subject: [PATCH] update --- src/components/frontend/page/home/results.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/frontend/page/home/results.tsx b/src/components/frontend/page/home/results.tsx index 15fe3ab..0418f58 100644 --- a/src/components/frontend/page/home/results.tsx +++ b/src/components/frontend/page/home/results.tsx @@ -27,7 +27,11 @@ const downloadImagesAsZip = (icons: { href: string, sizes?: string }[], domain: const JSZip = JSZipModule.default; const zip = new JSZip(); const folder = zip.folder(`${domain}-images`); - const saveAs = FileSaverModule.saveAs; + const saveAs = FileSaverModule.default || FileSaverModule.saveAs; + if (typeof saveAs !== 'function') { + console.error('saveAs is not a function', FileSaverModule); + return; + } const addBase64Image = ({ base64Data, index, sizes }: { base64Data: string; index: number, sizes?: string; }) => { const data = base64Data.split(',')[1];