format lap times + only display valid scans

ref #11
This commit is contained in:
Philipp Dormann 2021-03-07 14:22:03 +01:00
parent c8d462100a
commit ff1f43e235
1 changed files with 6 additions and 4 deletions

View File

@ -142,9 +142,7 @@
<td class="px-4 py-3">
<span v-text="s.distance"></span>m
</td>
<td class="px-4 py-3">
<span v-text="s.lapTime"></span>s
</td>
<td class="px-4 py-3" v-text="s.lapTime"></td>
</tr>
</tbody>
</table>
@ -201,8 +199,12 @@ axios.get(`${config.baseurl}api/runners/me/${token}`)
})
axios.get(`${config.baseurl}api/runners/me/${token}/scans`)
.then(({ data }) => {
data.map(function(s) {
s.lapTime = Math.floor(s.lapTime / 60) + 'min ' + (Math.floor(s.lapTime % 60) + "").padStart(2, "0") + "s"
return s;
})
data.filter(s => s.valid === true);
state.scans = data;
// TODO: filter for valid=true scans only
}).catch((error) => {
toast.error("An error occured while loading your profile data");
})