CorentinTh / it-tools

Collection of handy online tools for developers, with great UX.
https://it-tools.tech
GNU General Public License v3.0
23.1k stars 2.8k forks source link

Favorite Button Not working on a tool #1365

Closed clintonleroux closed 3 weeks ago

clintonleroux commented 3 weeks ago

Describe the bug

When on a tool, the favorite button is not working. I plan to submit a PR

What happened?

When clicking the favorite button it is not adding to favorite (on a tool only not on home page)

System information

System: OS: Windows 11 10.0.22631 CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13600KF Memory: 5.18 GB / 15.82 GB Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527

Where did you encounter the bug?

Other (installations, docker, etc.)

gitmotion commented 3 weeks ago

@clintonleroux @CorentinTh added fix here: https://github.com/CorentinTh/it-tools/pull/1368

before and after: beforeafterdemo

gitmotion commented 3 weeks ago

- previously was not passing the route path to the object when passing as tool: toollayoutonlypassesname frompageonlypassesname

- this also caused it to add nulls to the favoritesToolName in local storage: addsnull

- adding the path should prevent nulls from getting added now but also added if check before adding directly to the store: after change