Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

fix due this week display logic, and showContact condition

ThieryMichel30f2d634718d
diff --git a/src/components/atomic-crm/dashboard/TasksListByDueDate.tsx b/src/components/atomic-crm/dashboard/TasksListByDueDate.tsx
index 40a1ce5b..3eb05df2 100644
--- a/src/components/atomic-crm/dashboard/TasksListByDueDate.tsx
+++ b/src/components/atomic-crm/dashboard/TasksListByDueDate.tsx
@@ -116,15 +116,14 @@ export const TasksListByDueDate = ({
showContact={showContact}
isMobile={isMobile}
/>
- {!filterByContact ||
- (isBeforeFriday && (
- <TaskListFilter
- tasks={dueThisWeekTasks}
- title="This week"
- showContact={showContact}
- isMobile={isMobile}
- />
- ))}
+ {(!filterByContact || (filterByContact && isBeforeFriday)) && (
+ <TaskListFilter
+ tasks={dueThisWeekTasks}
+ title="This week"
+ showContact={showContact}
+ isMobile={isMobile}
+ />
+ )}
<TaskListFilter
tasks={dueLaterTasks}
title="Later"
diff --git a/src/components/atomic-crm/dashboard/TasksListFilter.tsx b/src/components/atomic-crm/dashboard/TasksListFilter.tsx
index 7b343896..ff010e92 100644
--- a/src/components/atomic-crm/dashboard/TasksListFilter.tsx
+++ b/src/components/atomic-crm/dashboard/TasksListFilter.tsx
@@ -32,7 +32,7 @@ export const TaskListFilter = ({
</p>
<ResourceContextProvider value="tasks">
<ListContextProvider value={listContext}>
- <TasksIterator showContact={showContact == null} />
+ <TasksIterator showContact={showContact} />
</ListContextProvider>
</ResourceContextProvider>
{total > listContext.perPage && (