Skip to content

Commit

Permalink
fix: eslint warnings in Recorder and useOverflowCheck (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoventura authored Sep 26, 2024
1 parent ff0c07b commit 3796bc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"ignorePatterns": ["resources/group_snippet.js"],
"plugins": ["import", "unused-imports", "@tanstack/query"],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {}
}
Expand Down
9 changes: 5 additions & 4 deletions src/hooks/useOverflowCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ export function useOverflowCheck(ref: React.RefObject<HTMLElement>) {
checkOverflow()

const resizeObserver = new ResizeObserver(checkOverflow)
if (ref.current) {
resizeObserver.observe(ref.current)
const currentRef = ref.current
if (currentRef) {
resizeObserver.observe(currentRef)
}

return () => {
if (ref.current) {
resizeObserver.unobserve(ref.current)
if (currentRef) {
resizeObserver.unobserve(currentRef)
}
}
}, [ref])
Expand Down
2 changes: 1 addition & 1 deletion src/views/Recorder/Recorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function Recorder() {
}
)
})
}, [validateAndSaveHarFile, showToast])
}, [validateAndSaveHarFile, showToast, navigate])

return (
<View
Expand Down

0 comments on commit 3796bc6

Please sign in to comment.