Skip to content

Commit

Permalink
fixed copy
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi0498 committed Feb 12, 2023
1 parent b767ac2 commit fba0af5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function run() {
newElement.classList.add("text--sec-color")
newElement.classList.add("text--ultra-semibold")
newElement.classList.add("material-symbols-outlined")
newElement.onclick = () => {
newElement.onclick = async () => {
const listOfTasks =
element.parentElement.nextElementSibling.children[0].children || []
console.log(listOfTasks)
Expand All @@ -59,7 +59,8 @@ export function run() {
tasks.push(`${texts[0]} - ${texts[1]}` + (name ? ` - ${name}` : ""))
}
try {
window.navigator.clipboard.writeText(tasks.join("\n"))
console.log(tasks.join("\n"))
await window.navigator.clipboard.writeText(tasks.join("\n"))
alert("Copied to clipboard")
} catch (error) {
console.log(error)
Expand Down

0 comments on commit fba0af5

Please sign in to comment.