Fix profile flashing on reload

This commit is contained in:
Bill 2022-03-23 02:05:30 -04:00
parent b9f4ee425e
commit ebaecde1dc

View File

@ -57,11 +57,22 @@ export const UserProfileView: FC<{}> = props =>
{
const parser = event.getParser();
let isSameProfile = false;
BatchUpdates(() =>
{
setUserProfile(parser);
setUserProfile(prevValue =>
{
isSameProfile = (prevValue.id === parser.id);
return parser;
});
if(!isSameProfile)
{
setUserBadges([]);
setUserRelationships(null);
}
});
SendMessageComposer(new UserCurrentBadgesComposer(parser.id));