AthletiFi / athletifi-website

Official website for AthletiFi
https://www.athleti.fi
1 stars 5 forks source link

BUG: Refresh card statuses automatically #337

Open qisforq opened 6 days ago

qisforq commented 6 days ago

Description The user data does not refresh automatically after invite, revoke, or decline actions. This issue causes the user interface to display outdated information. Currently, the workaround involves using window.location.reload(), which refreshes the entire page and leads to a poor user experience. The goal is to refresh only the relevant component and update the UI with the latest data.

Steps to Reproduce

Invite a guest:

Revoke an invite:

Decline an invite:

Expected Behavior The user data should automatically refresh and update the UI to reflect the changes after performing invite, revoke, or decline actions without reloading the entire page.

Actual Behavior The UI displays outdated information and requires a full page reload (window.location.reload()) to display the updated data.

Possible Solution Use a custom hook to refresh the user data by fetching the latest data and updating the userDataAtom state. Call this hook after performing invite, revoke, or decline actions. Avoid using window.location.reload().