Client:Calendar:Fixed crash when clicking on a day in the calendar.

This commit is contained in:
Vlada Gazizova 2024-08-29 15:49:23 +03:00
parent fe010d398b
commit 085f780bfa
2 changed files with 6 additions and 7 deletions

View File

@ -44,7 +44,7 @@ const HistoryBlock = ({ t, feed, isLastEntity }) => {
return (
<StyledHistoryBlock
className={json.ModifiedDate}
className={date}
withBottomDivider={!isLastEntity}
isUserAction={isUserAction}
>

View File

@ -96,8 +96,8 @@ const History = ({
if (dateCoincidingWithCalendarDay) return false;
item.feeds.every((feed) => {
if (feed.json.ModifiedDate.slice(0, 10) === calendarDay) {
dateCoincidingWithCalendarDay = feed.json.ModifiedDate;
if (feed.date.slice(0, 10) === calendarDay) {
dateCoincidingWithCalendarDay = feed.date;
}
});
@ -125,7 +125,7 @@ const History = ({
if (nearestNewerDate) return false;
item.feeds.every((feed) => {
const date = new Date(feed.json.ModifiedDate);
const date = new Date(feed.date);
//Stop checking all entries for one day
if (date > calendarDayModified) return false;
@ -134,12 +134,11 @@ const History = ({
if (date < calendarDayModified) {
//If there are no nearby new entries in the post history, then scroll to the last one
if (indexItem === 0) {
nearestNewerDate = feed.json.ModifiedDate;
nearestNewerDate = feed.date;
return false;
}
nearestNewerDate =
selectionHistory[indexItem - 1].feeds[0].json.ModifiedDate;
nearestNewerDate = selectionHistory[indexItem - 1].feeds[0].date;
}
});