From ddcdc9d1d21237a59ebe099ec9b24cfc9e4eeb4e Mon Sep 17 00:00:00 2001 From: zurdi Date: Tue, 28 May 2024 18:45:46 +0200 Subject: [PATCH] store romsPerPage in localStorage --- frontend/src/components/Game/DataTable/Base.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Game/DataTable/Base.vue b/frontend/src/components/Game/DataTable/Base.vue index 8fe76ebaf..7ad10bc6c 100644 --- a/frontend/src/components/Game/DataTable/Base.vue +++ b/frontend/src/components/Game/DataTable/Base.vue @@ -78,7 +78,8 @@ const downloadStore = storeDownload(); const romsStore = storeRoms(); const auth = storeAuth(); const page = ref(1); -const romsPerPage = ref(10); +const storedRomsPerPage = parseInt(localStorage.getItem("romsPerPage") ?? ""); +const romsPerPage = ref(isNaN(storedRomsPerPage) ? 25 : storedRomsPerPage); const pageCount = ref(0); // Functions @@ -93,6 +94,7 @@ function updateDataTablePages() { } watch(romsPerPage, async () => { + localStorage.setItem("romsPerPage", romsPerPage.value.toString()); updateDataTablePages(); });