diff --git a/app/Views/shared/script_validation.php b/app/Views/shared/script_validation.php index c547085..f44cd02 100644 --- a/app/Views/shared/script_validation.php +++ b/app/Views/shared/script_validation.php @@ -273,9 +273,17 @@ document.addEventListener('alpine:init', () => { item => item.SP_ACCESSNUMBER !== accessnumber ); + this.computeUnvalidatedFiltered(); + this.computeUnvalidatedSorted(); + this.computeUnvalidatedTotalPages(); + if (this.currentPage > this.unvalidatedTotalPages) { + this.currentPage = this.unvalidatedTotalPages; + } + this.computeUnvalidatedPaginated(); + const filteredLength = this.unvalidatedFiltered.length; - if (filteredLength > 0) { - const nextIndex = Math.min(this.currentIndex, filteredLength - 1); + if (filteredLength > 0 && this.currentIndex < filteredLength) { + const nextIndex = this.currentIndex; this.closeValDialog(); setTimeout(() => this.openValDialogByIndex(nextIndex), 50); } else {