this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix future posts messing up Catch-up

+9 -4
+9 -4
src/pages/catchup.jsx
··· 2090 2090 ); 2091 2091 2092 2092 // Calculate the time span in milliseconds 2093 - const range = maxDate.getTime() - minDate.getTime(); 2093 + const range = Math.min(maxDate.getTime(), Date.now()) - minDate.getTime(); 2094 2094 2095 2095 // Create empty bins and loop through data 2096 2096 const bins = Array.from({ length: numBins }, () => []); 2097 2097 data.forEach((item) => { 2098 2098 const date = new Date(item[key]); 2099 - const normalized = (date.getTime() - minDate.getTime()) / range; 2100 - const binIndex = Math.floor(normalized * (numBins - 1)); 2101 - bins[binIndex].push(item); 2099 + if (date.getTime() > Date.now()) { 2100 + // Future dates go into the last bin 2101 + bins[bins.length - 1].push(item); 2102 + } else { 2103 + const normalized = (date.getTime() - minDate.getTime()) / range; 2104 + const binIndex = Math.floor(normalized * (numBins - 1)); 2105 + bins[binIndex].push(item); 2106 + } 2102 2107 }); 2103 2108 2104 2109 return bins;