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 { Dropdown, DropDownProps } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
const DropDownActions: React.FC<DropDownProps> = (props) => {
|
||||
@@ -14,7 +15,7 @@ const DropDownActions: React.FC<DropDownProps> = (props) => {
|
||||
|
||||
const items = useMemo(() => {
|
||||
return menu?.items?.map((item: any) => ({
|
||||
...item,
|
||||
..._.omit(item, 'locale'),
|
||||
label: item.locale ? intl.formatMessage({ id: item.label }) : item.label
|
||||
}));
|
||||
}, [menu?.items, intl]);
|
||||
|
||||
@@ -269,7 +269,7 @@ const TableRow: React.FC<
|
||||
})}
|
||||
</Row>
|
||||
</div>
|
||||
{expanded && childrenData.length > 0 && (
|
||||
{expanded && (
|
||||
<div className="expanded-row">
|
||||
<Spin spinning={loading}>{renderChildrenData()}</Spin>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,6 @@ import dayjs from 'dayjs';
|
||||
import { useAtom } from 'jotai';
|
||||
import _ from 'lodash';
|
||||
import React, {
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
@@ -880,4 +879,4 @@ const Models: React.FC<ModelsProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default memo(Models);
|
||||
export default Models;
|
||||
|
||||
Reference in New Issue
Block a user