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:
YANG QIA 2025-02-11 22:17:04 +08:00 committed by GitHub
parent 33052fbd8d
commit c1b55cece9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}