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(); const parser = event.getParser();
let isSameProfile = false;
BatchUpdates(() => BatchUpdates(() =>
{ {
setUserProfile(parser); setUserProfile(prevValue =>
{
isSameProfile = (prevValue.id === parser.id);
return parser;
});
if(!isSameProfile)
{
setUserBadges([]); setUserBadges([]);
setUserRelationships(null); setUserRelationships(null);
}
}); });
SendMessageComposer(new UserCurrentBadgesComposer(parser.id)); SendMessageComposer(new UserCurrentBadgesComposer(parser.id));