Skip to content

Commit

Permalink
fix: Wait until notification column is added when higlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed Nov 23, 2023
1 parent 5ea8cce commit d0ca996
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ function App() {
useEffect(() => {
if (!highlighted) return
if (!spaceRef.current) return
const node = document.getElementById(highlighted.id.toString())
scrollLeft(spaceRef.current, node.offsetLeft)
setTimeout(() => {
const node = document.getElementById(highlighted.id.toString())
if (node) {
scrollLeft(spaceRef.current, node.offsetLeft)
}
}, 500)
}, [highlighted])

const handleKeyPress = useCallback(async (event: KeyboardEvent) => {
Expand Down

0 comments on commit d0ca996

Please sign in to comment.