this repo has no description
0
fork

Configure Feed

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

If beyond 12 hours, allow last catch up's end timing

+26 -3
+26 -3
src/pages/catchup.jsx
··· 191 191 192 192 const [posts, setPosts] = useState([]); 193 193 const catchupRangeRef = useRef(); 194 + const catchupLastRef = useRef(); 194 195 const NS = useMemo(() => getCurrentAccountNS(), []); 195 196 const handleCatchupClick = useCallback(async ({ duration } = {}) => { 196 197 const now = Date.now(); ··· 925 926 type="button" 926 927 onClick={() => { 927 928 if (range < RANGES[RANGES.length - 1].value) { 928 - const duration = range * 60 * 60 * 1000; 929 + let duration; 930 + if ( 931 + range === RANGES[RANGES.length - 1].value && 932 + catchupLastRef.current?.checked 933 + ) { 934 + duration = Date.now() - lastCatchupEndAt; 935 + } else { 936 + duration = range * 60 * 60 * 1000; 937 + } 929 938 handleCatchupClick({ duration }); 930 939 } else { 931 940 handleCatchupClick(); ··· 935 944 Catch up 936 945 </button> 937 946 </div> 938 - {lastCatchupRange && range > lastCatchupRange && ( 947 + {lastCatchupRange && range > lastCatchupRange ? ( 939 948 <p class="catchup-info"> 940 949 <Icon icon="info" /> Overlaps with your last catch-up 941 950 </p> 942 - )} 951 + ) : range === RANGES[RANGES.length - 1].value && 952 + lastCatchupEndAt ? ( 953 + <p class="catchup-info"> 954 + <label> 955 + <input 956 + type="checkbox" 957 + switch 958 + checked 959 + ref={catchupLastRef} 960 + />{' '} 961 + Until the last catch-up ( 962 + {dtf.format(new Date(lastCatchupEndAt))}) 963 + </label> 964 + </p> 965 + ) : null} 943 966 <p class="insignificant"> 944 967 <small> 945 968 Note: your instance might only show a maximum of 800 posts in