chore: refac

This commit is contained in:
Timothy J. Baek 2023-12-26 12:50:52 -08:00
parent f30d16a3fd
commit cc49e0d10f
11 changed files with 239 additions and 397 deletions

View file

@ -66,9 +66,9 @@ export const getGravatarURL = (email) => {
return `https://www.gravatar.com/avatar/${hash}`;
};
const copyToClipboard = (text) => {
export const copyToClipboard = (text) => {
if (!navigator.clipboard) {
var textArea = document.createElement('textarea');
const textArea = document.createElement('textarea');
textArea.value = text;
// Avoid scrolling to bottom
@ -81,8 +81,8 @@ const copyToClipboard = (text) => {
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
const successful = document.execCommand('copy');
const msg = successful ? 'successful' : 'unsuccessful';
console.log('Fallback: Copying text command was ' + msg);
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);