mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix: move visibility check for action button to the correct location
This commit is contained in:
parent
0b78432a01
commit
e80ef27f79
@ -19,6 +19,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { ErrorFallback, StablePopover, TabsContextProvider, useActionContext } from '../..';
|
import { ErrorFallback, StablePopover, TabsContextProvider, useActionContext } from '../..';
|
||||||
import { useDesignable } from '../../';
|
import { useDesignable } from '../../';
|
||||||
import { useACLActionParamsContext } from '../../../acl';
|
import { useACLActionParamsContext } from '../../../acl';
|
||||||
|
import { useApp } from '../../../application';
|
||||||
import {
|
import {
|
||||||
useCollectionParentRecordData,
|
useCollectionParentRecordData,
|
||||||
useCollectionRecordData,
|
useCollectionRecordData,
|
||||||
@ -554,11 +555,6 @@ const RenderButtonInner = observer(
|
|||||||
title,
|
title,
|
||||||
...others
|
...others
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (!designable && (field?.data?.hidden || !aclCtx)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const debouncedClick = useCallback(
|
const debouncedClick = useCallback(
|
||||||
debounce(
|
debounce(
|
||||||
(e: React.MouseEvent, checkPortal = true) => {
|
(e: React.MouseEvent, checkPortal = true) => {
|
||||||
@ -576,6 +572,10 @@ const RenderButtonInner = observer(
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
if (!designable && (field?.data?.hidden || !aclCtx)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const actionTitle = title || field?.title;
|
const actionTitle = title || field?.title;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user