fix: reload round data when navigating holes

Co-authored-by: aider (openrouter/thinkingmachines/inkling-small:free) <aider@aider.chat>
This commit is contained in:
Jiří Stachandaider committed 2026-10-09 23:08:26 +02:00
1 parent 74769f057f
commit ebf52f3443
1 file changed
+3 -9
+3 -9
View File
@@ -119,21 +119,15 @@ function prevHole() {
if (currentIndex > 0) { if (currentIndex > 0) {
saveHole().then(() => { saveHole().then(() => {
currentIndex--; currentIndex--;
const holes = currentData.holes.sort((a,b) => a.hole_number - b.hole_number); loadRound();
renderHole(holes[currentIndex]);
renderNav(holes);
}); });
} }
} }
function nextHole() { function nextHole() {
saveHole().then(() => { saveHole().then(() => {
const holes = currentData.holes.sort((a,b) => a.hole_number - b.hole_number); currentIndex++;
if (currentIndex < holes.length - 1) { loadRound();
currentIndex++;
renderHole(holes[currentIndex]);
renderNav(holes);
}
}); });
} }