Skip to content

Commit

Permalink
chore: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
illfixit committed Mar 11, 2024
1 parent 3373571 commit 94516f6
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import {Injectable} from '@angular/core';
import {ToastService} from '../toast-notifications/toast.service';

// adjust the path as needed

@Injectable({
providedIn: 'root',
})
Expand All @@ -25,21 +23,17 @@ export class ClipboardUtils {
const textarea = document.createElement('textarea');
textarea.value = text;

// Append the textarea to the document
document.body.appendChild(textarea);
textarea.select();
navigator.clipboard
.writeText(text)
.then(() => {
// On success, show a toast notification
this.toastService.showSuccess('Copied to clipboard');
})
.catch(() => {
// On failure, show a toast notification
this.toastService.showDanger('Failed to copy to clipboard');
});

// Remove the textarea from the document
document.body.removeChild(textarea);
}
}

0 comments on commit 94516f6

Please sign in to comment.