Added Notifications
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export const copyToClipboard = (text: string): Promise<void> => {
|
||||
if (navigator.clipboard) {
|
||||
return navigator.clipboard.writeText(text);
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const el = document.createElement('textarea');
|
||||
el.value = text;
|
||||
document.body.appendChild(el);
|
||||
el.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(el);
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user