Skip to content

Commit ec68479

Browse files
fix: Ensure real-time updates to records in reports after actions are performed
1 parent b387b6b commit ec68479

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

apps/OpenSign/src/primitives/GetReportDisplay.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ReportTable = (props) => {
5454
const [isLoader, setIsLoader] = useState({});
5555
// const [selectedPublicRole, setSelectedPublicRole] = useState("");
5656
// const [isCelebration, setIsCelebration] = useState(false);
57-
const [currentLists, setCurrentLists] = useState([]);
57+
// const [currentLists, setCurrentLists] = useState([]);
5858
// const [isPublic, setIsPublic] = useState({});
5959
// const [isPublicProfile, setIsPublicProfile] = useState({});
6060
// const [publicUserName, setIsPublicUserName] = useState("");
@@ -250,19 +250,20 @@ const ReportTable = (props) => {
250250
// Get current list
251251
const indexOfLastDoc = currentPage * props.docPerPage;
252252
const indexOfFirstDoc = indexOfLastDoc - props.docPerPage;
253-
useEffect(() => {
254-
// `currentLists` is total record render on current page
255-
const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
256-
//check public template and save in a object to show public and private template
257-
// setIsPublic(
258-
// currentList.reduce((acc, item) => {
259-
// acc[item.objectId] = item?.IsPublic || false;
260-
// return acc;
261-
// }, {})
262-
// );
263-
setCurrentLists(currentList);
264-
// eslint-disable-next-line react-hooks/exhaustive-deps
265-
}, [indexOfLastDoc, indexOfFirstDoc]);
253+
const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
254+
// useEffect(() => {
255+
// // `currentLists` is total record render on current page
256+
// const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
257+
// //check public template and save in a object to show public and private template
258+
// // setIsPublic(
259+
// // currentList.reduce((acc, item) => {
260+
// // acc[item.objectId] = item?.IsPublic || false;
261+
// // return acc;
262+
// // }, {})
263+
// // );
264+
// setCurrentLists(currentList);
265+
// // eslint-disable-next-line react-hooks/exhaustive-deps
266+
// }, [indexOfLastDoc, indexOfFirstDoc]);
266267

267268
// Change page
268269
const paginateFront = () => setCurrentPage(currentPage + 1);
@@ -928,7 +929,7 @@ const ReportTable = (props) => {
928929
<tbody className="text-[12px]">
929930
{props.List?.length > 0 && (
930931
<>
931-
{currentLists.map((item, index) =>
932+
{currentList.map((item, index) =>
932933
props.ReportName === "Contactbook" ? (
933934
<tr className="border-y-[1px]" key={index}>
934935
{props.heading.includes("Sr.No") && (

0 commit comments

Comments
 (0)