diff --git a/src/lib/utils/community-route-utils.test.ts b/src/lib/utils/community-route-utils.test.ts index 667dd3a5..4f0ebabc 100644 --- a/src/lib/utils/community-route-utils.test.ts +++ b/src/lib/utils/community-route-utils.test.ts @@ -71,8 +71,8 @@ describe('community route builders', () => { expect(getCommunityPostPath(PUBLIC_KEY, 'bafy-post-cid')).toBe(`/s/${PUBLIC_KEY}/comments/bafy-post-cid`); }); - it('builds the exact seedit.app external post URL', () => { - expect(getCommunityPostUrl('aww.bso', 'bafy-post-cid')).toBe('https://seedit.app/s/aww.bso/comments/bafy-post-cid'); + it('builds the exact s.seedit.app external post URL', () => { + expect(getCommunityPostUrl('aww.bso', 'bafy-post-cid')).toBe('https://s.seedit.app/s/aww.bso/comments/bafy-post-cid'); }); it('keeps explicit directory paths separate from exact community paths', () => { diff --git a/src/lib/utils/community-route-utils.ts b/src/lib/utils/community-route-utils.ts index f644e25a..c697bfee 100644 --- a/src/lib/utils/community-route-utils.ts +++ b/src/lib/utils/community-route-utils.ts @@ -39,7 +39,7 @@ export const getCommunityPostPath = (communityAddress: string, cid: string): str export const getCommunityReferencePostPath = (communityReference: string, cid: string): string => `${getCommunityReferencePath(communityReference)}/comments/${encodeURIComponent(cid)}`; -export const getCommunityPostUrl = (communityAddress: string, cid: string): string => `https://seedit.app${getCommunityPostPath(communityAddress, cid)}`; +export const getCommunityPostUrl = (communityAddress: string, cid: string): string => `https://s.seedit.app${getCommunityPostPath(communityAddress, cid)}`; export const getExactCommunityActionRedirectPath = ( pathname: string, diff --git a/src/lib/utils/url-utils.test.ts b/src/lib/utils/url-utils.test.ts index 2a00a6b8..c68e6054 100644 --- a/src/lib/utils/url-utils.test.ts +++ b/src/lib/utils/url-utils.test.ts @@ -6,12 +6,14 @@ const CID = 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3fteh2v6q2f6x2w4g3q'; describe('Seedit comments permalinks', () => { it('recognizes direct, hash-routed, and short-host comments URLs', () => { expect(isSeeditLink(`https://seedit.app/s/aww/comments/${CID}`)).toBe(true); + expect(isSeeditLink(`https://s.seedit.app/s/aww/comments/${CID}`)).toBe(true); expect(isSeeditLink(`https://seedit.app/#/s/aww/comments/${CID}`)).toBe(true); expect(isSeeditLink(`https://pleb.bz/s/aww/comments/${CID}`)).toBe(true); }); it('transforms external comments URLs to the matching internal route', () => { expect(transformSeeditLinkToInternal(`https://seedit.app/s/aww/comments/${CID}`)).toBe(`/s/aww/comments/${CID}`); + expect(transformSeeditLinkToInternal(`https://s.seedit.app/s/aww/comments/${CID}`)).toBe(`/s/aww/comments/${CID}`); expect(transformSeeditLinkToInternal(`https://seedit.app/#/s/aww/comments/${CID}`)).toBe(`/s/aww/comments/${CID}`); }); diff --git a/src/lib/utils/url-utils.ts b/src/lib/utils/url-utils.ts index ddab33b5..121e4fdb 100644 --- a/src/lib/utils/url-utils.ts +++ b/src/lib/utils/url-utils.ts @@ -29,7 +29,7 @@ export const copyShareLinkToClipboard = async (communityAddress: string, cid: st await copyToClipboard(shareLink); }; -const SEEDIT_HOSTNAMES = ['seedit.app', 'seedit.eth.limo', 'seedit.eth.link', 'seedit.eth.sucks', 'seedit.netlify.app', 'pleb.bz']; +const SEEDIT_HOSTNAMES = ['seedit.app', 's.seedit.app', 'seedit.eth.limo', 'seedit.eth.link', 'seedit.eth.sucks', 'seedit.netlify.app', 'pleb.bz']; // Check if a URL is a valid seedit link that should be handled internally export const isSeeditLink = (url: string): boolean => {