Skip to content

Commit

Permalink
fix: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Nov 3, 2023
1 parent d843763 commit c83feea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/src/components/UserInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const UserInfo = (props: IUserInfo) => {
<div className="user-detail-wrapper">
<div className="user-appearance-wrapper">
<div className="user-appearance-box">
<Appearance clothes={clothes || player.equip.clothes} handheld={handheld || player.equip.handheld} head={head || player.equip.head}/>
<Appearance clothes={clothes || player?.equip?.clothes} handheld={handheld || player?.equip?.handheld} head={head || player?.equip?.head}/>
</div>
</div>
<div className={`loot-wrapper ${lootHasLoaded ? 'loaded' : ''}`}>
Expand Down
6 changes: 6 additions & 0 deletions packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ const Home = () => {
setHandheld(handheld);
setHead(head);

playerData.equip = {
clothes,
handheld,
head,
}

let player = Object.assign(playerData, {username, clothes, handheld, head, userUrl: url.image, lootUrl: lootUrl.image})
console.log(player, 'player')
localStorage.setItem('playerInfo', JSON.stringify(toObject(player)));
Expand Down

0 comments on commit c83feea

Please sign in to comment.