Skip to content

Commit 9ae02bb

Browse files
committed
refactor: optional chaining
1 parent 4128eea commit 9ae02bb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/components/Code/FileTree.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ const { toggleDir, isExpanded, autoExpandAncestors } = useFileTreeState(props.ba
3838
3939
const scrollIntoView = () => {
4040
const el = treeRoot.value?.querySelector('[aria-current="true"]') as HTMLElement
41-
if (el) {
42-
el.scrollIntoView({ block: 'center', behavior: 'smooth' })
43-
}
41+
el?.scrollIntoView({ block: 'center', behavior: 'smooth' })
4442
}
4543
4644
// Auto-expand directories in the current path

0 commit comments

Comments
 (0)