Closed MKuijpers closed 1 year ago
Fixed in 860a1c18dab275770d5bfe2bfa808b0ee2301bbb in PR #113 (not merged at time of posting)
Instead of using userId, this fixes the problem of showing data of previously logged-in users by just clearing the react-query cache on logout.
At the moment, the cache of sticker packs is independent of any user. If you were to logout and log in with a new user, the old cache of the previous user would still be valid until the next request fetches the stickerpacks of the new user.
This can be fixed by making the query key of all
/me
-based queries based on the userId. For exampleQUERY_KEYS.myStickerPacks
should become something like[QUERY_KEYS.myStickerPacks, userId]
.