Fixed bugs in ViewBar filtering (#7608)

- Fixed CSS for SortOrFilter chips
- Fixed bug when refreshing with an actor source filter set

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2024-10-11 20:25:15 +02:00
committed by GitHub
parent 7b96be6f8c
commit fef3d32237
5 changed files with 108 additions and 98 deletions

View File

@ -36,8 +36,7 @@ export const triggerDestroyRecordsOptimisticEffect = ({
const rootQueryCachedObjectRecordConnection = rootQueryCachedResponse;
const recordIdsToDelete = recordsToDestroy.map(({ id }) => id);
const recordIdsToDestroy = recordsToDestroy.map(({ id }) => id);
const cachedEdges = readField<RecordGqlRefEdge[]>(
'edges',
rootQueryCachedObjectRecordConnection,
@ -52,7 +51,7 @@ export const triggerDestroyRecordsOptimisticEffect = ({
cachedEdges?.filter((cachedEdge) => {
const nodeId = readField<string>('id', cachedEdge.node);
return nodeId && !recordIdsToDelete.includes(nodeId);
return nodeId && !recordIdsToDestroy.includes(nodeId);
}) || [];
if (nextCachedEdges.length === cachedEdges?.length)
@ -62,7 +61,7 @@ export const triggerDestroyRecordsOptimisticEffect = ({
...rootQueryCachedObjectRecordConnection,
edges: nextCachedEdges,
totalCount: isDefined(totalCount)
? totalCount - recordIdsToDelete.length
? totalCount - recordIdsToDestroy.length
: undefined,
};
},