From ac8c49d954148dc6389f7ac0d373aa1729f1a0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 22 Nov 2021 23:18:47 +0100 Subject: [PATCH] Prepend 0 to index if under 10 on Photo Viewer --- src/routes/[country]/[location]/[photo].svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/[country]/[location]/[photo].svelte b/src/routes/[country]/[location]/[photo].svelte index 09d3c90..39a0892 100644 --- a/src/routes/[country]/[location]/[photo].svelte +++ b/src/routes/[country]/[location]/[photo].svelte @@ -33,6 +33,7 @@ $: canGoNext = !isLoading && (hasPrev || currentIndex !== 0) // Define current photo $: currentPhoto = photos[currentIndex] + $: currentPhotoIndex = globalOffset + currentIndex + 1 // Take 7 photos in the global photos array (5 for current, 1 before first and 1 after last) // Start one index before the current image since the first one will be invisible @@ -191,7 +192,7 @@ - {globalOffset + currentIndex + 1} + {(currentPhotoIndex < 10) ? '0' : ''}{currentPhotoIndex}