From f13c19f880cf024d610dd20f1f6ab5aabdf5b189 Mon Sep 17 00:00:00 2001 From: Heiko Joerg Schick Date: Tue, 5 May 2026 15:36:49 +0200 Subject: [PATCH] Show error feedback when clipboard copy fails --- src/thread-modal.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/thread-modal.ts b/src/thread-modal.ts index 29793a5..24effd0 100644 --- a/src/thread-modal.ts +++ b/src/thread-modal.ts @@ -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); + }); }); } }