From af57f8c0f4410a45f47826c386b59daf0407beef Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Mon, 1 Apr 2024 09:43:30 +0530 Subject: [PATCH] minor fix for long dataset items page getting blank --- src/ui/pages/component/common/DataitemsTable.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ui/pages/component/common/DataitemsTable.jsx b/src/ui/pages/component/common/DataitemsTable.jsx index 3e10a06fd..5f5808d72 100644 --- a/src/ui/pages/component/common/DataitemsTable.jsx +++ b/src/ui/pages/component/common/DataitemsTable.jsx @@ -56,8 +56,15 @@ const DataitemsTable = () => { const [searchAnchor, setSearchAnchor] = useState(null); const searchOpen = Boolean(searchAnchor); const [searchedCol, setSearchedCol] = useState(); - localStorage.setItem("DataitemsList", JSON.stringify(columns)); - localStorage.setItem("Dataitem", JSON.stringify(dataitemsList)); + + useEffect(()=>{ + try{ + localStorage.setItem("DataitemsList", JSON.stringify(columns)); + localStorage.setItem("Dataitem", JSON.stringify(dataitemsList)); + }catch{ + console.log("Local storage set item quota exceeded") + } + }, [columns, dataitemsList]); const getDataitems = () => { const dataObj = new GetDataitemsById(