Skip to content

Commit

Permalink
fixed starknet id fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
retroboydev committed Dec 13, 2023
1 parent 07bca3c commit ea135cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/contexts/LpContestData.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { LP_CONTEST_DATA, LP_CONTEST_NFT_RANK } from '../apollo/queries'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { convertHexToDecimal } from '../utils'
import { number as starknetNumberModule } from 'starknet'

const UPDATE = 'UPDATE'
const UPDATE_PLAYERS_DATA = 'UPDATE_PLAYERS_DATA'
Expand Down Expand Up @@ -154,13 +155,13 @@ export function Updater() {
const processedResponse = await response.json()
const domains = processedResponse.reduce((acc, userData) => {
if (userData.domain && userData.address) {
acc[userData.address] = userData.domain
acc[starknetNumberModule.cleanHex(userData.address)] = userData.domain
}
return acc
}, {})

payloadData.forEach((data) => {
data.starknetIdDomain = domains?.[convertedAddressed?.[data?.user?.id]] || '' // Здесь добавляется новое поле
data.starknetIdDomain = domains?.[data?.user?.id] || ''
})
} catch (e) {
} finally {
Expand Down

0 comments on commit ea135cc

Please sign in to comment.