File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ const platforms = [
5555 id =" mastodon-input"
5656 placeholder =" mastodon.social"
5757 type =" text"
58- value ={ url }
5958 data-encoded-text ={ encodedText }
6059 data-encoded-url ={ encodedUrl }
6160 />
@@ -131,6 +130,15 @@ const platforms = [
131130 ) as HTMLDialogElement;
132131 element?.addEventListener("click", () => {
133132 navigator.clipboard.writeText(element.dataset.url ?? window.location.href);
133+ const icon = element.querySelector("span");
134+ if (icon) {
135+ icon.classList.remove("ph-link");
136+ icon.classList.add("ph-check");
137+ setTimeout(() => {
138+ icon.classList.remove("ph-check");
139+ icon.classList.add("ph-link");
140+ }, 1000);
141+ }
134142 });
135143 document.getElementById("mastodon-btn")?.addEventListener("click", () => {
136144 mastodonDialog.showModal();
@@ -139,6 +147,7 @@ const platforms = [
139147
140148 function submitMastodon() {
141149 const input = mastodonInput.value;
150+ if (!input) return;
142151 const { encodedText, encodedUrl } = mastodonInput.dataset;
143152 const link = `https://${input}/share?text=${encodedText}&url=${encodedUrl}`;
144153 window.open(link, "_blank");
You can’t perform that action at this time.
0 commit comments