Skip to content

Commit

Permalink
fix: fixed user giving undefined for info
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed Mar 28, 2024
1 parent 85cf829 commit b23cd7a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/uiweb/src/lib/hooks/chat/useChatProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ const useChatProfile = () => {
}: FetchProfileParams): Promise<any> => {
try {
let userReadOnly;
if(profileId && user)
userReadOnly = await user!.info({ overrideAccount: profileId });
else
userReadOnly = await user!.info();
if(user){
if(profileId)
userReadOnly = await user!.info({ overrideAccount: profileId });
else
userReadOnly = await user!.info();
}

return userReadOnly;
} catch (error) {
console.log(error);
Expand Down

0 comments on commit b23cd7a

Please sign in to comment.