Skip to content

Commit

Permalink
fix: map embed urls and encode text (#3696)
Browse files Browse the repository at this point in the history
  • Loading branch information
veganbeef authored Oct 18, 2024
1 parent 7ea61f7 commit a7110ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function createFarcasterShareUrl(
embedLinks: string[]
) {
// NB: embed links should not be encoded
return `https://warpcast.com/~/compose?text=${shareText}${embedLinks.forEach((link) => `&embeds[]=${link}`)}`;
return `https://warpcast.com/~/compose?text=${shareText}${embedLinks.map((link) => `&embeds[]=${link}`)}`;
}

type TwitterButtonParams = {
Expand Down
7 changes: 4 additions & 3 deletions packages/grant-explorer/src/features/round/ViewRoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,10 @@ const ShareButton = ({
shareText + window.location.href
)}`;

const farcasterShareUrl = createFarcasterShareUrl(shareText, [
window.location.href,
]);
const farcasterShareUrl = createFarcasterShareUrl(
encodeURIComponent(shareText),
[window.location.href]
);

return (
<>
Expand Down

0 comments on commit a7110ae

Please sign in to comment.