forked from CSGOWTF/csgowtf
fixed broken elements due to api changes
This commit is contained in:
@@ -10,7 +10,7 @@ export const GetUser = async (id) => {
|
||||
if (res.status === 200)
|
||||
return [res.status, res.data]
|
||||
} catch (err) {
|
||||
if (err.response.status === 404)
|
||||
if (err.response)
|
||||
return [err.response.status, err.response.statusText]
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export const TrackMe = async (id64, authcode, sharecode) => {
|
||||
|
||||
try {
|
||||
const res = await axios
|
||||
.post(`${API_URL}/player/trackme`, `id=${id64}&authcode=${authcode}&sharecode=${sharecode}`)
|
||||
.post(`${API_URL}/player/${id64}/track`, `authcode=${authcode}&sharecode=${sharecode}`)
|
||||
|
||||
if (res.status === 202) {
|
||||
status = res.status
|
||||
|
||||
@@ -48,9 +48,12 @@ export const getPlayerArr = (stats, team, color) => {
|
||||
export const constructAvatarUrl = (hash, size) => {
|
||||
const base = 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars'
|
||||
const imgSize = size ? `_${size}` : ''
|
||||
const hashDir = hash.substring(0, 2)
|
||||
|
||||
return `${base}/${hashDir}/${hash}${imgSize}.jpg`
|
||||
if (hash) {
|
||||
const hashDir = hash.substring(0, 2)
|
||||
|
||||
return `${base}/${hashDir}/${hash}${imgSize}.jpg`
|
||||
}
|
||||
}
|
||||
|
||||
export const GetAvgRank = (stats) => {
|
||||
|
||||
Reference in New Issue
Block a user