Skip to content

Commit

Permalink
fix: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Oct 31, 2023
1 parent 5286c1f commit 7bb5cd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/client/src/pages/game/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ const Game = () => {
player.username = player.name;
LootList1Data.forEach((item) => {
if (item.addr.toLocaleLowerCase() === address.toLocaleLowerCase()) {
let clothes = lootData.chest.split('\" ')[1].split(' of')[0]
let handheld = lootData.weapon.split('\" ')[1].split(' of')[0]
let head = lootData.head.split('\" ')[1].split(' of')[0]
let clothes = lootData.chest.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
let handheld = lootData.weapon.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
let head = lootData.head.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
player.equip = {
clothes,
handheld,
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ const Home = () => {
let playerData = rep[0]
let lootData = rep[1]

let clothes = lootData.chest.split('\" ')[1].split(' of')[0]
let handheld = lootData.weapon.split('\" ')[1].split(' of')[0]
let head = lootData.head.split('\" ')[1].split(' of')[0]
let clothes = lootData.chest.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
let handheld = lootData.weapon.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
let head = lootData.head.replace(/"(.*?)"/, '').split(' of')[0].replace(/^\s+|\s+$/g,"")
setPlayer(playerData)
setClothes(clothes);
setHandheld(handheld);
Expand Down

0 comments on commit 7bb5cd4

Please sign in to comment.