From 1d12417cb0324a0ad89e17ce97c871512b829a71 Mon Sep 17 00:00:00 2001 From: baizhi958216 <1475289190@qq.com> Date: Mon, 8 Jun 2026 19:24:40 +0800 Subject: [PATCH 1/2] fix(share): remove infiplot file download event before enter gallery page Signed-off-by: baizhi958216 <1475289190@qq.com> --- app/play/page.tsx | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/play/page.tsx b/app/play/page.tsx index c88cfb5..5c83ce5 100644 --- a/app/play/page.tsx +++ b/app/play/page.tsx @@ -1027,28 +1027,28 @@ function PlayInner() { // way; this happens in the background. Server returns 503 if // GALLERY_SECRET isn't configured, in which case we silently skip — the // local view still works, just no share file. - void (async () => { - try { - const r = await fetch("/api/gallery-pack", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ docStr }), - }); - if (!r.ok) return; - const blob = await r.blob(); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = `infiplot-${id}.infiplot`; - a.rel = "noopener"; - document.body.appendChild(a); - a.click(); - a.remove(); - setTimeout(() => URL.revokeObjectURL(url), 2000); - } catch { - // network / decrypt error — local view above already worked - } - })(); + // void (async () => { + // try { + // const r = await fetch("/api/gallery-pack", { + // method: "POST", + // headers: { "Content-Type": "application/json" }, + // body: JSON.stringify({ docStr }), + // }); + // if (!r.ok) return; + // const blob = await r.blob(); + // const url = URL.createObjectURL(blob); + // const a = document.createElement("a"); + // a.href = url; + // a.download = `infiplot-${id}.infiplot`; + // a.rel = "noopener"; + // document.body.appendChild(a); + // a.click(); + // a.remove(); + // setTimeout(() => URL.revokeObjectURL(url), 2000); + // } catch { + // // network / decrypt error — local view above already worked + // } + // })(); }, [trimGalleryExports]); const handleExportStory = useCallback(() => { From 24b97fa3fbadb6c2849043427c4ab913ce652f90 Mon Sep 17 00:00:00 2001 From: baizhi958216 <1475289190@qq.com> Date: Mon, 8 Jun 2026 19:29:40 +0800 Subject: [PATCH 2/2] chore(share): remove stale gallery pack code Signed-off-by: baizhi958216 <1475289190@qq.com> --- app/play/page.tsx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/app/play/page.tsx b/app/play/page.tsx index 5c83ce5..f58967f 100644 --- a/app/play/page.tsx +++ b/app/play/page.tsx @@ -1021,34 +1021,6 @@ function PlayInner() { } track("gallery_export", { scene_count: scenes.length }); window.open(`/gallery#id=${id}`, "_blank", "noopener"); - - // Fire-and-forget: also pack an encrypted `.infiplot` share file for the - // player to send to a friend. The local-tab view above is instant either - // way; this happens in the background. Server returns 503 if - // GALLERY_SECRET isn't configured, in which case we silently skip — the - // local view still works, just no share file. - // void (async () => { - // try { - // const r = await fetch("/api/gallery-pack", { - // method: "POST", - // headers: { "Content-Type": "application/json" }, - // body: JSON.stringify({ docStr }), - // }); - // if (!r.ok) return; - // const blob = await r.blob(); - // const url = URL.createObjectURL(blob); - // const a = document.createElement("a"); - // a.href = url; - // a.download = `infiplot-${id}.infiplot`; - // a.rel = "noopener"; - // document.body.appendChild(a); - // a.click(); - // a.remove(); - // setTimeout(() => URL.revokeObjectURL(url), 2000); - // } catch { - // // network / decrypt error — local view above already worked - // } - // })(); }, [trimGalleryExports]); const handleExportStory = useCallback(() => {