refactor: disable pagination moved to a function

reduces repeated code
This commit is contained in:
Aryan Kothari
2024-08-03 19:40:31 -04:00
parent f9e1a933a9
commit cdac0cd1df
3 changed files with 15 additions and 31 deletions
+7
View File
@@ -1,6 +1,7 @@
import { v4 as uuidv4 } from 'uuid';
import sha256 from 'js-sha256';
import { WEBUI_BASE_URL } from '$lib/constants';
import { scrollPaginationEnabled, pageLimit, pageSkip } from '$lib/stores';
//////////////////////////
// Helper functions
@@ -779,3 +780,9 @@ export const bestMatchingLanguage = (supportedLanguages, preferredLanguages, def
console.log(languages, preferredLanguages, match, defaultLocale);
return match || defaultLocale;
};
export const disablePagination = () => {
scrollPaginationEnabled.set(false);
pageLimit.set(-1);
pageSkip.set(0);
};