Code Monkey home page Code Monkey logo

Comments (5)

lauslim12 avatar lauslim12 commented on August 13, 2024 1

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.

from genshin-schedule.

lauslim12 avatar lauslim12 commented on August 13, 2024

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...

image

image

image

Works perfectly! What do you think? I can drop a PR if you wish!

from genshin-schedule.

luaneko avatar luaneko commented on August 13, 2024

That would be great!

from genshin-schedule.

lauslim12 avatar lauslim12 commented on August 13, 2024

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!

from genshin-schedule.

luaneko avatar luaneko commented on August 13, 2024

That's what I was looking for :)

from genshin-schedule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.