cleanup currentPage when it's 0 too

This commit is contained in:
xenofem 2024-07-07 01:38:50 -04:00
parent 3b533452bc
commit fa5e5a1f6a

View file

@ -169,7 +169,7 @@ document.addEventListener('DOMContentLoaded', () => {
function exitToWork() {
changeDuration(duration, true);
if (currentPage === IMAGES.length - 1) {
if (currentPage === IMAGES.length - 1 || currentPage === 0) {
localStorage.removeItem(`${WORK_ID}-currentPage`);
}
window.location.href = `../${INDEX}`;