Skip to content

Commit e8e8b0f

Browse files
committed
fix(ChangelogDialog): fix sb
1 parent 8b891ac commit e8e8b0f

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/components/ChangelogDialog/ChangelogDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function ChangelogDialog({
4343
onClose,
4444
onStoryClick,
4545
onLinkClick,
46-
loading = true,
46+
loading,
4747
}: ChangelogDialogProps) {
4848
const idRef = React.useRef<number>();
4949
idRef.current = idRef.current || getNextId();

src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useEffect} from 'react';
1+
import React from 'react';
22

33
import {Button} from '@gravity-ui/uikit';
44
import type {Meta, StoryFn} from '@storybook/react';
@@ -79,22 +79,11 @@ const items: ChangelogItem[] = [
7979

8080
const DefaultTemplate: StoryFn<ChangelogDialogProps> = (props: ChangelogDialogProps) => {
8181
const [visible, setVisible] = React.useState(props.open);
82-
const [loading, setLoading] = React.useState(true);
8382

8483
React.useEffect(() => {
8584
setVisible(props.open);
8685
}, [props.open]);
8786

88-
useEffect(() => {
89-
if (!visible) return;
90-
const timeoutId = setTimeout(() => setLoading(false), 1000);
91-
// eslint-disable-next-line consistent-return
92-
return () => {
93-
clearTimeout(timeoutId);
94-
setLoading(true);
95-
};
96-
}, [visible]);
97-
9887
return (
9988
<React.Fragment>
10089
<div>
@@ -109,7 +98,6 @@ const DefaultTemplate: StoryFn<ChangelogDialogProps> = (props: ChangelogDialogPr
10998
<ChangelogDialog
11099
{...props}
111100
open={visible}
112-
loading={loading}
113101
onClose={(event, reason) => {
114102
setVisible(false);
115103
props.onClose?.(event, reason);

0 commit comments

Comments
 (0)