Skip to content

Commit

Permalink
Feat: 사진 테스트(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
sayyyho committed Aug 6, 2024
1 parent b7b3c22 commit 0154269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/pages/Share/Share.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SharePage = () => {
const res = await getStarContent(starid);
setStarP(res);
} catch (error) {
console.error("Error fetching star data:", error);
console.log("..");
}
};

Expand All @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
Expand Down

0 comments on commit 0154269

Please sign in to comment.