Skip to content

Commit

Permalink
Refactor selected class removal
Browse files Browse the repository at this point in the history
  • Loading branch information
iammearl committed Dec 30, 2023
1 parent 59ce874 commit ec083ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ function recentColorTray({
tray.classList.add("recent-color-tray")

const updateSelectedClass = (element?: HTMLElement) => {
;[...tray.getElementsByClassName("recent-color")].forEach((e) => {
e.classList.remove("selected")
})
tray.querySelector(".recent-color.selected")?.classList.remove("selected");
element?.classList.add("selected")
}
return {
Expand Down

0 comments on commit ec083ed

Please sign in to comment.