diff --git a/config/sections/mixins/pagination.php b/config/sections/mixins/pagination.php index ba3cdf5508..39f8d0a1da 100644 --- a/config/sections/mixins/pagination.php +++ b/config/sections/mixins/pagination.php @@ -12,7 +12,7 @@ return $limit; }, /** - * Sets the default page for the pagination. This will overwrite default pagination. + * Sets the default page for the pagination. */ 'page' => function (int|null $page = null) { return App::instance()->request()->get('page', $page); diff --git a/panel/src/components/Sections/ModelsSection.vue b/panel/src/components/Sections/ModelsSection.vue index 63348ced72..dbb7880c1e 100644 --- a/panel/src/components/Sections/ModelsSection.vue +++ b/panel/src/components/Sections/ModelsSection.vue @@ -143,7 +143,7 @@ export default { ...this.emptyProps, text: this.searching ? this.$t("search.results.none") - : this.options.empty ?? this.emptyProps.text + : (this.options.empty ?? this.emptyProps.text) }; }, items() { @@ -197,7 +197,9 @@ export default { } const page = - this.pagination.page ?? localStorage.getItem(this.paginationId) ?? 1; + this.pagination.page ?? + sessionStorage.getItem(this.paginationId) ?? + null; try { const response = await this.$api.get( @@ -222,7 +224,7 @@ export default { onDrop() {}, onSort() {}, onPaginate(pagination) { - localStorage.setItem(this.paginationId, pagination.page); + sessionStorage.setItem(this.paginationId, pagination.page); this.pagination = pagination; this.reload(); },