Skip to content

Commit

Permalink
Merge pull request #1583 from lumi-tip/development-lumi-7639
Browse files Browse the repository at this point in the history
🐛 when editting attendance user will not experience a reset of the attendance after 30-50seconds
  • Loading branch information
tommygonzaleza authored Sep 3, 2024
2 parents 4454902 + b6f1c38 commit d9b2861
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/common/components/AttendanceModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ AttendanceModal.defaultProps = {
title: '',
message: '',
isOpen: true,
onClose: () => {},
onClose: () => { },
};

export default AttendanceModal;
7 changes: 4 additions & 3 deletions src/common/components/LiveEvent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,16 @@ function LiveEvent({

useEffect(() => {
let intervalVar;
// applyFilters();
updateTimes();

setTimeout(() => {
const timeoutId = setTimeout(() => {
updateTimes();
intervalVar = setInterval(updateTimes(), 60 * 1000);
intervalVar = setInterval(updateTimes, 60 * 1000);
}, secondsToNextMinute * 1000);

return () => {
clearInterval(intervalVar);
clearTimeout(timeoutId);
};
}, [mainClasses, otherEvents]);

Expand Down
11 changes: 0 additions & 11 deletions src/pages/cohort/[cohortSlug]/[slug]/[version]/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
includesToLowerCase,
getStorageItem,
sortToNearestTodayDate,
syncInterval,
getBrowserSize,
calculateDifferenceDays,
adjustNumberBeetwenMinMax,
Expand Down Expand Up @@ -266,16 +265,6 @@ function Dashboard() {
},
});
});
syncInterval(() => {
setLiveClasses((prev) => {
const validatedEventList = prev?.length > 0
? prev?.filter((l) => isValidDate(l?.starting_at) && isValidDate(l?.ending_at))
: [];
const sortDateToLiveClass = sortToNearestTodayDate(validatedEventList, TwelveHours);
const existentLiveClasses = sortDateToLiveClass?.filter((l) => l?.hash && l?.starting_at && l?.ending_at);
return existentLiveClasses;
});
});
}, []);

// Fetch cohort data with pathName structure
Expand Down

0 comments on commit d9b2861

Please sign in to comment.