refactor: use padZero function for numbers

This commit is contained in:
2024-08-03 12:24:52 +02:00
parent 3bbfb8c5dd
commit 717b1d2f40
3 changed files with 14 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
import { seenLocations } from '$utils/stores'
import { photoFields } from '$utils/api'
import { PUBLIC_LIST_INCREMENT } from '$env/static/public'
import { padZero } from 'utils/string'
// Components
import Metas from '$components/Metas.svelte'
import Image from '$components/atoms/Image.svelte'
@@ -294,7 +295,7 @@
location={location.name}
ratio={width / height}
date={date_taken}
index="{(totalPhotos - index < 10) ? '0' : ''}{totalPhotos - index}"
index={padZero(totalPhotos - index)}
/>
{/each}
</section>