mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 15:39:24 +08:00
fix(data-vi): chart blocks do not display when added to the popups of action panel (#6198)
* fix(data-vi): charts do not display when added to the popups of action panel * chore: add optional chain
This commit is contained in:
parent
33052fbd8d
commit
c1b55cece9
@ -16,11 +16,11 @@ import _ from 'lodash';
|
||||
export const ChartBlockProvider: React.FC = (props) => {
|
||||
const currentPopupContext = useCurrentPopupContext();
|
||||
const localVariables = useLocalVariables();
|
||||
const popUpCtxReady =
|
||||
_.isEmpty(currentPopupContext) ||
|
||||
localVariables?.some((variable) => variable.name === '$nPopupRecord' && variable.ctx);
|
||||
const popupRecordVariable = localVariables?.find((variable) => variable.name === '$nPopupRecord');
|
||||
const popupCtxReady =
|
||||
_.isEmpty(currentPopupContext) || !popupRecordVariable?.collectionName || popupRecordVariable?.ctx;
|
||||
|
||||
if (!popUpCtxReady) {
|
||||
if (!popupCtxReady) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user