Fixed bugs with stuff not being displayed🛠

ref #92
This commit is contained in:
2021-03-17 20:02:04 +01:00
parent 284bdc6e33
commit ff1bc8a44a
2 changed files with 4 additions and 15 deletions

View File

@@ -22,7 +22,8 @@
return id.toString() === searchvalue;
}
function format_laptime(laptime){
if(laptime < 60){return laptime.toString}
if(laptime == 0 || laptime == null){return "First scan of the day."}
if(laptime < 60){return `${laptime}s`}
if(laptime < 3600){return `${Math.floor(laptime / 60)}min ${laptime - (Math.floor(laptime / 60)*60)}s`}
return `${Math.floor(laptime / 3600)}h ${laptime - (Math.floor(laptime / 3600)*3600)}min ${laptime - (Math.floor(laptime / 3600)*3600) - (Math.floor(laptime / 60)*60)}`
}
@@ -119,9 +120,9 @@
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
{#if scan.laptime}
{#if scan.responseType === "TRACKSCAN"}
<div class="text-sm font-medium text-gray-900">
{format_laptime(scan.laptime)}
{format_laptime(scan.lapTime)}
</div>
{:else}
<div class="text-sm font-medium text-gray-900">