@@ -267,6 +267,7 @@ import BootstrapVue from "bootstrap-vue";
267267import { initFolderTableIcons } from " components/Libraries/icons" ;
268268import { DEFAULT_PER_PAGE , MAX_DESCRIPTION_LENGTH } from " components/Libraries/library-utils" ;
269269import UtcDate from " components/UtcDate" ;
270+ import { usePersistentRef } from " composables/persistentRef" ;
270271import { Toast } from " composables/toast" ;
271272import { sanitize } from " dompurify" ;
272273import linkifyHtml from " linkify-html" ;
@@ -342,7 +343,10 @@ export default {
342343 ... mapState (useUserStore, [" currentUser" ]),
343344 },
344345 watch: {
345- perPage () {
346+ perPage (newValue ) {
347+ if (this .perPageRef ) {
348+ this .perPageRef .value = newValue;
349+ }
346350 this .fetchFolderContents ();
347351 },
348352 includeDeleted () {
@@ -357,6 +361,8 @@ export default {
357361 },
358362 created () {
359363 this .services = new Services ({ root: this .root });
364+ this .perPageRef = usePersistentRef (" library-folder-per-page" , DEFAULT_PER_PAGE );
365+ this .perPage = this .perPageRef .value ;
360366 this .getFolder (this .folder_id , this .page );
361367 },
362368 methods: {
@@ -370,6 +376,10 @@ export default {
370376 resetData () {
371377 const data = initialFolderState ();
372378 Object .keys (data).forEach ((k ) => (this [k] = data[k]));
379+ // Restore perPage from localStorage after reset
380+ if (this .perPageRef ) {
381+ this .perPage = this .perPageRef .value ;
382+ }
373383 },
374384 onSort (props ) {
375385 this .sortBy = props .sortBy ;
0 commit comments