RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
126 stars 252 forks source link

Store user's info if not present or if not same user #72

Closed sidmohanty11 closed 1 year ago

sidmohanty11 commented 1 year ago

Description:

https://github.com/RocketChat/EmbeddedChat/pull/51 solves it partially by adding a me call to the API when there is no user info stored in our localstorage but if the user changed its cookies into a new user's cookies he will still get his user profile image as the previous one and also the app would show indeterministic UI.

Steps to reproduce:

Note: During development only!

  1. Login into EmbeddedChat
  2. Login into some other account in RC
  3. Come back to see in EC that you have the same profile image as before but you message with the user you logged in with in RC.

Expected behavior:

User details should get updated

Actual behavior:

They don't.

Extra

You can take help of this PR to get everything working if user's info is missing and add into it a functionality to check if the user has been changed midway! This could be possible if we add a check to user_id cookie to a stored version at localstorage or if you have an amazing way, please feel free to post it here!

VipinDevelops commented 1 year ago

Hey @sidmohanty11 I'm willing to work on this issue

Can you assign it to me please 😄