Fixed bug for refectch activities and create activity on the currently filtered user. (#1493)
* Fixed bug for refectch activities and create activity on the currently filtered user. * Refactor optimistif effect --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -5,13 +5,13 @@ import { IconPlus } from '@/ui/icon';
|
||||
import { ActivityType } from '~/generated/graphql';
|
||||
|
||||
export function AddTaskButton({
|
||||
entity,
|
||||
activityTargetEntity,
|
||||
}: {
|
||||
entity?: ActivityTargetableEntity;
|
||||
activityTargetEntity?: ActivityTargetableEntity;
|
||||
}) {
|
||||
const openCreateActivity = useOpenCreateActivityDrawer();
|
||||
|
||||
if (!entity) {
|
||||
if (!activityTargetEntity) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,12 @@ export function AddTaskButton({
|
||||
size="small"
|
||||
variant="secondary"
|
||||
title="Add task"
|
||||
onClick={() => openCreateActivity(ActivityType.Task, [entity])}
|
||||
onClick={() =>
|
||||
openCreateActivity({
|
||||
type: ActivityType.Task,
|
||||
targetableEntities: [activityTargetEntity],
|
||||
})
|
||||
}
|
||||
></Button>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user