fix: do not cache while watching during manual updates

This commit is contained in:
jialin
2026-02-13 19:32:59 +08:00
parent 88aafbaf7b
commit 511297ed11
8 changed files with 28 additions and 14 deletions
+10 -1
View File
@@ -81,6 +81,7 @@ const DeleteModal = forwardRef((props, ref) => {
const [configuration, setConfiguration] = useState<Configuration>({
checked: false
});
const [delLoading, setDelLoading] = useState(false);
const [config, setConfig] = useState<ModalFuncProps & DataOptions>({} as any);
const show = (data: ModalFuncProps & DataOptions) => {
@@ -105,6 +106,7 @@ const DeleteModal = forwardRef((props, ref) => {
const handleOk = async () => {
try {
setDelLoading(true);
const res = await config.onOk?.();
const isArray = Array.isArray(res);
if (isArray) {
@@ -121,6 +123,7 @@ const DeleteModal = forwardRef((props, ref) => {
// Handle error if needed
} finally {
setVisible(false);
setDelLoading(false);
restoreScrollHeight();
}
};
@@ -156,7 +159,13 @@ const DeleteModal = forwardRef((props, ref) => {
? intl.formatMessage({ id: config.cancelText })
: intl.formatMessage({ id: 'common.button.cancel' })}
</Button>
<Button type="primary" onClick={handleOk} size="middle" danger>
<Button
type="primary"
onClick={handleOk}
size="middle"
danger
loading={delLoading}
>
{config.okText
? intl.formatMessage({ id: config.okText })
: intl.formatMessage({ id: 'common.button.delete' })}