HemmeligOrg / Hemmelig.app

Keep your sensitive information out of chat logs, emails, and more with encrypted secrets.
https://hemmelig.app
MIT License
681 stars 57 forks source link

refactor: use react router loader to fetch data to eliminate the use of useEffect #283

Closed bjarneo closed 5 months ago

bjarneo commented 5 months ago

This pull request includes major changes to the routing and data fetching in the client-side codebase, as well as a small change to the server-side settings controller. The changes mainly involve moving the data fetching logic from individual components to the router, and using the useLoaderData hook to access the fetched data in the components. This simplifies the components by removing unnecessary state and effect hooks related to data fetching, and centralizes the data fetching logic in the router.

Changes to the router:

Changes to components:

Change to server-side controller:

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud