server connections

This commit is contained in:
Jan Prochazka
2020-05-01 13:19:42 +02:00
parent ca7eea8a05
commit bfef6b57dd
7 changed files with 72 additions and 40 deletions

View File

@@ -34,14 +34,30 @@ function AppObjectListItem({ makeAppObj, data, filter, appobj, onObjectClick, Su
const [isExpanded, setIsExpanded] = React.useState(false);
const [isHover, setIsHover] = React.useState(false);
React.useEffect(() => {
if (!appobj.isExpandable) {
// if (data._id == '6pOY2iFY8Gsq7mk6') console.log('COLLAPSE1');
setIsExpanded(false);
}
}, [appobj && appobj.isExpandable]);
// const { matcher } = appobj;
// if (matcher && !matcher(filter)) return null;
if (onObjectClick) appobj.onClick = onObjectClick;
if (onObjectClick)
appobj = {
...appobj,
onClick: onObjectClick,
};
if (SubItems) {
const oldClick = appobj.onClick;
appobj.onClick = () => {
if (oldClick) oldClick();
setIsExpanded(!isExpanded);
appobj = {
...appobj,
onClick: () => {
if (oldClick) oldClick();
// if (data._id == '6pOY2iFY8Gsq7mk6') console.log('COLLAPSE2');
setIsExpanded((v) => !v);
},
};
}