JS share API

This commit is contained in:
Parsa Yazdani (Quix) 2025-03-09 21:30:26 +11:00
parent 016f07cfb6
commit 54a105acc8

View file

@ -731,9 +731,9 @@ async function submitVote(proposalId, voteType, isPetition = false, petitionDeta
}
if (shareButton) {
shareButton.addEventListener('click', () => {
// Copy the shareable link to clipboard
copyToClipboard(getShareableLink(proposal.id));
shareButton.addEventListener('click', async () => {
if ('share' in navigator) await navigator.share({ title: 'What do you think?', text: proposal.text, url: getShareableLink(proposal.id) });
else copyToClipboard(getShareableLink(proposal.id));
});
}
});