Fix getCurrentChapterId: Use parseFloat instead of parseInt to support decimal chapters

This commit is contained in:
小虾米 2026-03-27 16:32:35 +08:00
parent 847d39ec54
commit f8dcd3c280

View File

@ -493,7 +493,8 @@ function initSidebar() {
function getCurrentChapterId() { function getCurrentChapterId() {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
return parseInt(urlParams.get('id')) || 1; const id = urlParams.get('id');
return id ? parseFloat(id) : 1;
} }
function recordReadingProgress(chapterId) { function recordReadingProgress(chapterId) {