fix: do not expand the instance list when request is pending

This commit is contained in:
jialin
2025-04-21 18:18:23 +08:00
parent 43b71c7532
commit d60e052f05
3 changed files with 4 additions and 4 deletions
+2 -1
View File
@@ -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>
+1 -2
View File
@@ -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;