Show error feedback when clipboard copy fails

This commit is contained in:
2026-05-05 15:36:49 +02:00
parent 6bd9693ea6
commit f13c19f880
+8 -2
View File
@@ -48,7 +48,10 @@ export class ThreadModal extends Modal {
navigator.clipboard.writeText(tweet).then(() => {
copyBtn.setText("Copied");
setTimeout(() => copyBtn.setText("Copy"), 2000);
}).catch(() => {});
}).catch(() => {
copyBtn.setText("Failed");
setTimeout(() => copyBtn.setText("Copy"), 2000);
});
});
}
@@ -62,7 +65,10 @@ export class ThreadModal extends Modal {
navigator.clipboard.writeText(all).then(() => {
copyAllBtn.setText("Copied");
setTimeout(() => copyAllBtn.setText("Copy all"), 2000);
}).catch(() => {});
}).catch(() => {
copyAllBtn.setText("Failed");
setTimeout(() => copyAllBtn.setText("Copy all"), 2000);
});
});
}
}