fix: do not expand the instance list when request is pending
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Dropdown, DropDownProps } from 'antd';
|
import { Dropdown, DropDownProps } from 'antd';
|
||||||
|
import _ from 'lodash';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
const DropDownActions: React.FC<DropDownProps> = (props) => {
|
const DropDownActions: React.FC<DropDownProps> = (props) => {
|
||||||
@@ -14,7 +15,7 @@ const DropDownActions: React.FC<DropDownProps> = (props) => {
|
|||||||
|
|
||||||
const items = useMemo(() => {
|
const items = useMemo(() => {
|
||||||
return menu?.items?.map((item: any) => ({
|
return menu?.items?.map((item: any) => ({
|
||||||
...item,
|
..._.omit(item, 'locale'),
|
||||||
label: item.locale ? intl.formatMessage({ id: item.label }) : item.label
|
label: item.locale ? intl.formatMessage({ id: item.label }) : item.label
|
||||||
}));
|
}));
|
||||||
}, [menu?.items, intl]);
|
}, [menu?.items, intl]);
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ const TableRow: React.FC<
|
|||||||
})}
|
})}
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
{expanded && childrenData.length > 0 && (
|
{expanded && (
|
||||||
<div className="expanded-row">
|
<div className="expanded-row">
|
||||||
<Spin spinning={loading}>{renderChildrenData()}</Spin>
|
<Spin spinning={loading}>{renderChildrenData()}</Spin>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import dayjs from 'dayjs';
|
|||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
memo,
|
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
@@ -880,4 +879,4 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(Models);
|
export default Models;
|
||||||
|
|||||||
Reference in New Issue
Block a user