Skip to content

Commit 3223c54

Browse files
committed
wip
1 parent cbefeb4 commit 3223c54

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/features/donation/components/DonationSuccess.tsx

+18-10
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,32 @@ export const DonationSuccess = ({ form, transactionHash, closeModal }: DonationS
126126
`\n\n🤝 Join me in supporting amazing projects:\n`,
127127
);
128128

129-
const url = encodeURIComponent(
130-
`${APP_DEFAULT_PUBLIC_URL}${rootPathnames.PROFILE}/${recipientAccountId}/donations`,
131-
// + viewer.isSignedIn
132-
// ? `?referrerAccountId=${viewer.accountId}`
133-
// : "",
134-
);
129+
const baseUrl = `${
130+
APP_DEFAULT_PUBLIC_URL
131+
}${rootPathnames.PROFILE}/${recipientAccountId}/donations`;
132+
133+
const fullUrl = viewer.isSignedIn
134+
? `${baseUrl}?referrerAccountId=${viewer.accountId}`
135+
: baseUrl;
135136

136-
const relation = encodeURIComponent(APP_DEFAULT_PUBLIC_URL);
137+
const encodedUrl = encodeURIComponent(fullUrl);
138+
const encodedRelation = encodeURIComponent(APP_DEFAULT_PUBLIC_URL);
137139

138140
return (
139141
twitterIntentBase +
140142
text +
141-
`&url=${url}` +
142-
`&related=${relation}` +
143+
`&url=${encodedUrl}` +
144+
`&related=${encodedRelation}` +
143145
`&hashtags=${DEFAULT_SHARE_HASHTAGS.join(",")}`
144146
);
145147
} else return undefined;
146-
}, [recipientAccountId, recipientSocialProfile]);
148+
}, [
149+
recipientAccountId,
150+
recipientSocialProfile?.linktree?.twitter,
151+
recipientSocialProfile?.name,
152+
viewer.accountId,
153+
viewer.isSignedIn,
154+
]);
147155

148156
return recipientProfileLoadingError !== undefined ||
149157
(!isResultLoading && recipientAccountId === undefined) ? (

0 commit comments

Comments
 (0)