diff options
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/components/pages/profile.js | 8 | ||||
| -rw-r--r-- | frontend/src/components/sidebar.js | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/frontend/src/components/pages/profile.js b/frontend/src/components/pages/profile.js index aa28546..041f585 100644 --- a/frontend/src/components/pages/profile.js +++ b/frontend/src/components/pages/profile.js | |||
| @@ -125,10 +125,11 @@ function NavClick() { | |||
| 125 | } | 125 | } |
| 126 | } | 126 | } |
| 127 | function UpdateProfile(){ | 127 | function UpdateProfile(){ |
| 128 | fetch(`/api/v1/profile`,{ | 128 | fetch(`https://lp.ardapektezol.com/api/v1/profile`,{ |
| 129 | method: 'POST', | 129 | method: 'POST', |
| 130 | headers: {Authorization: token} | 130 | headers: {Authorization: token} |
| 131 | }).then(r=>window.location.reload()) | 131 | }).then(r=>r.json()) |
| 132 | .then(d=>d.success?window.location.reload():window.alert(`Error: ${d.message}`)) | ||
| 132 | } | 133 | } |
| 133 | 134 | ||
| 134 | function TimeAgo(date) { | 135 | function TimeAgo(date) { |
| @@ -221,7 +222,7 @@ return ( | |||
| 221 | </div> | 222 | </div> |
| 222 | <div> | 223 | <div> |
| 223 | <span>Cooperative</span> | 224 | <span>Cooperative</span> |
| 224 | <span>{profileData.rankings.cooperative.rank===0?"N/A":"#"+profileData.rankings.cooperative.rank+" "} | 225 | <span>{profileData.rankings.cooperative.rank===0?"N/A ":"#"+profileData.rankings.cooperative.rank+" "} |
| 225 | <span>({profileData.rankings.cooperative.completion_count}/{profileData.rankings.cooperative.completion_total})</span> | 226 | <span>({profileData.rankings.cooperative.completion_count}/{profileData.rankings.cooperative.completion_total})</span> |
| 226 | </span> | 227 | </span> |
| 227 | </div> | 228 | </div> |
| @@ -285,7 +286,6 @@ return ( | |||
| 285 | <hr/> | 286 | <hr/> |
| 286 | <div id='profileboard-records'> | 287 | <div id='profileboard-records'> |
| 287 | 288 | ||
| 288 | {console.log(profileData)} | ||
| 289 | {game == 0 && profileData !== null | 289 | {game == 0 && profileData !== null |
| 290 | ? ( | 290 | ? ( |
| 291 | 291 | ||
diff --git a/frontend/src/components/sidebar.js b/frontend/src/components/sidebar.js index e587c3c..29859ab 100644 --- a/frontend/src/components/sidebar.js +++ b/frontend/src/components/sidebar.js | |||
| @@ -184,7 +184,7 @@ return ( | |||
| 184 | {searchData!==null?searchData.players.map((q,index)=> | 184 | {searchData!==null?searchData.players.map((q,index)=> |
| 185 | ( | 185 | ( |
| 186 | <Link to={ | 186 | <Link to={ |
| 187 | q.steam_id===profile.steam_id?`/profile`: | 187 | profile!==null&&q.steam_id===profile.steam_id?`/profile`: |
| 188 | `/users/${q.steam_id}` | 188 | `/users/${q.steam_id}` |
| 189 | } className='search-player' key={index}> | 189 | } className='search-player' key={index}> |
| 190 | <img src={q.avatar_link} alt='pfp'></img> | 190 | <img src={q.avatar_link} alt='pfp'></img> |