Skip to content

Commit e4e4db4

Browse files
author
Artyom Podymov
committed
fix pr comments
1 parent e2ef64b commit e4e4db4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

redisinsight/ui/src/pages/workbench/components/enablament-area/EnablementArea/EnablementArea.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ const EnablementArea = ({ items, openScript, loading }: Props) => {
3838
if (pagePath) {
3939
setIsInternalPageVisible(true)
4040
setInternalPage({ path: pagePath })
41-
} else if (guideFromContext) {
41+
return
42+
}
43+
if (guideFromContext) {
4244
handleOpenInternalPage({ path: guideFromContext })
43-
} else {
44-
setIsInternalPageVisible(false)
45+
return
4546
}
47+
setIsInternalPageVisible(false)
4648
}, [search])
4749

4850
const handleOpenInternalPage = (page: IInternalPage) => {

redisinsight/ui/src/pages/workbench/components/enablament-area/EnablementArea/components/InternalPage/InternalPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const InternalPage = (props: Props) => {
3737
const { onClose, title, backTitle, isLoading, error, content, onScroll, scrollTop } = props
3838
const components: any = { LazyCodeButton, Carousel, InternalLink, Image }
3939
const containerRef = useRef<HTMLDivElement>(null)
40-
const handleScroll = () => {
40+
const handleScroll = debounce(() => {
4141
if (containerRef.current && onScroll) {
4242
onScroll(containerRef.current.scrollTop)
4343
}
44-
}
44+
}, 500)
4545

4646
useEffect(() => {
4747
if (!isLoading && !error && scrollTop && containerRef.current) {
@@ -61,7 +61,7 @@ const InternalPage = (props: Props) => {
6161
), [content])
6262

6363
return (
64-
<div ref={containerRef} className={styles.container} data-test-subj="internal-page" onScroll={debounce(handleScroll, 500)}>
64+
<div ref={containerRef} className={styles.container} data-test-subj="internal-page" onScroll={handleScroll}>
6565
<EuiFlyoutHeader className={styles.header}>
6666
<EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
6767
<EuiFlexItem grow={false}>

0 commit comments

Comments
 (0)