fix: removing from group fixed

This commit is contained in:
2025-05-12 01:06:51 +04:00
parent cc39d13b1c
commit 4fee2da42c

View File

@@ -37,7 +37,7 @@ const CardSummaryItem: FC<Props> = ({ cardSummary, color }) => {
});
};
const isLockedInsideGroup = () => {
return cardSummary.group && !cardSummary.group.billRequests;
return !!(cardSummary?.group?.billRequests && cardSummary?.group?.billRequests?.length !== 0);
};
useEffect(() => {
@@ -47,12 +47,12 @@ const CardSummaryItem: FC<Props> = ({ cardSummary, color }) => {
return (
<div
onContextMenu={showContextMenu([
...isLockedInsideGroup() ? [{
...isLockedInsideGroup() ? [] : [{
key: "removeFromGroup",
onClick: () => onDeleteFromGroup(cardSummary),
title: "Убрать из группы",
icon: <IconLayoutGridRemove />,
}] : [],
}],
{
key: "complete",
onClick: () => onComplete(cardSummary),