Show error feedback when clipboard copy fails
This commit is contained in:
+8
-2
@@ -48,7 +48,10 @@ export class ThreadModal extends Modal {
|
|||||||
navigator.clipboard.writeText(tweet).then(() => {
|
navigator.clipboard.writeText(tweet).then(() => {
|
||||||
copyBtn.setText("Copied");
|
copyBtn.setText("Copied");
|
||||||
setTimeout(() => copyBtn.setText("Copy"), 2000);
|
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(() => {
|
navigator.clipboard.writeText(all).then(() => {
|
||||||
copyAllBtn.setText("Copied");
|
copyAllBtn.setText("Copied");
|
||||||
setTimeout(() => copyAllBtn.setText("Copy all"), 2000);
|
setTimeout(() => copyAllBtn.setText("Copy all"), 2000);
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
copyAllBtn.setText("Failed");
|
||||||
|
setTimeout(() => copyAllBtn.setText("Copy all"), 2000);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user