react-appwrite
react-appwrite copied to clipboard
Session changes on other devices replaces state on local device
If I am logged in on device A and device B.
- Device B logs out
- Device A gets the logout event and replaces whole state with the ended session from Device B
(It of course also triggers on more cases, like when you are on logged in on Device A and a device B logs in)
https://github.com/react-appwrite/react-appwrite/blob/8f6b7284bc3152d98b9b2320792d88fba79542ec/src/account/useAccount.ts#L45
Edit: Just realized also that you probaby expect a UserObject in that set, but session changes payload is a SessionObject. So it's the wrong kind of data
It also breaks useTeams since it is dependent on useAccount
Ah, yeah I see what you mean. Good catch. I'm looking into this.