mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
Fix seeing other users' badges on route change
This commit is contained in:
parent
64d0f95f3b
commit
939e6bbd68
|
|
@ -114,6 +114,12 @@ function SocialLinkIcon({ type }: Pick<SocialLinkProps, "type">) {
|
|||
|
||||
function BadgeContainer(props: { badges: UserPageLoaderData["badges"] }) {
|
||||
const [badges, setBadges] = React.useState(props.badges);
|
||||
|
||||
// keep badges in sync when route changes from one user profile to another
|
||||
React.useEffect(() => {
|
||||
setBadges(props.badges);
|
||||
}, [props.badges]);
|
||||
|
||||
const [bigBadge, ...smallBadges] = badges;
|
||||
if (!bigBadge) return null;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user