diff options
| author | Nidboj132 <28981031+Nidboj132@users.noreply.github.com> | 2023-11-16 20:26:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 20:26:21 +0100 |
| commit | dcdbe09670ae2923badbb4120c2334c063176af3 (patch) | |
| tree | 7fd1df7f3063ff20d0568d2996e55c10f30b8c19 /frontend/src/components/pages/profile.js | |
| parent | feat: error check on 0 portal 0 tick record (#133) (diff) | |
| download | lphub-dcdbe09670ae2923badbb4120c2334c063176af3.tar.gz lphub-dcdbe09670ae2923badbb4120c2334c063176af3.tar.bz2 lphub-dcdbe09670ae2923badbb4120c2334c063176af3.zip | |
fix: crash (#54)
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/components/pages/profile.js | 8 |
1 files changed, 4 insertions, 4 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 | ||