mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 18:32:36 +01:00
Fix profile flashing on reload
This commit is contained in:
parent
b9f4ee425e
commit
ebaecde1dc
@ -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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user