diff --git a/src/pages/Share/Share.jsx b/src/pages/Share/Share.jsx index bc851414..730fa477 100644 --- a/src/pages/Share/Share.jsx +++ b/src/pages/Share/Share.jsx @@ -23,7 +23,7 @@ const SharePage = () => { const res = await getStarContent(starid); setStarP(res); } catch (error) { - console.error("Error fetching star data:", error); + console.log(".."); } }; @@ -37,7 +37,6 @@ const SharePage = () => { const canvas = await html2canvas(captureRef.current, { useCORS: true }); await captureScreenshot(canvas); } catch (error) { - console.error("Error capturing screenshot:", error); } finally { setIsButtonVisible(true); } diff --git a/src/utils/share.js b/src/utils/share.js index 0f94e0fb..8e4dabba 100644 --- a/src/utils/share.js +++ b/src/utils/share.js @@ -9,10 +9,10 @@ export const captureScreenshot = async (canvas) => { const dataUrl = canvas.toDataURL("image/png"); const blob = await fetch(dataUrl).then((res) => res.blob()); - // Web Share API 사용 + // Use Web Share API if available if (navigator.share) { - navigator.share({ - // files: [new File([blob], "start.png", { type: "image/png" })], + await navigator.share({ + files: [new File([blob], "start.png", { type: "image/png" })], title: "STAR.T", text: "likelion-start.site", });