Closed luaneko closed 3 years ago
I think I found the bug.
I noticed that your useDueTasks
utility function does not actually search for the query that we typed in the search box. So, I modified your useDueTasks
code a bit and...
Works perfectly! What do you think? I can drop a PR if you wish!
That would be great!
I guess my solution was incorrect 😅.
Thanks for the feedback though, if I managed to find another solution that suits your feedback, I'll make a PR again.
Hey, I think I managed to find a solution according to your feedback.
It's actually pretty simple, it goes like the following:
Old one:
const dueTasks = useDueTasks(tasks);
New one:
const dueTasks = useDueTasks(tasks);
const filteredTasks = useFilteredTasks(dueTasks); // after getting due tasks, filter them according to the user's query.
// The next parts are just replacing 'dueTasks' with 'filteredTasks'
I believe the reason of why the search button never worked - is because we never called useFilteredTasks
in the first place. The reason the map worked fine is because we have called the useFilteredTasks
function in the taskDispatches
(TaskLayer
component).
All of the changes happen in the TaskListCard
.
What do you think? I tested in it my local machine and it works perfectly. Hope it doesn't incur any of negative side effects or bugs though!
That's what I was looking for :)
Task list should be hiding mismatches but it does not. Current:
Expected:
Map is unaffected and works as expected.