chore: reduce window size for global tab to 1min
This commit is contained in:
parent
2858deb462
commit
eb002e065c
@ -16,16 +16,18 @@ export interface TimelineProps {
|
||||
postsOnly: boolean,
|
||||
subject: TimelineSubject,
|
||||
method: "TIME_RANGE" | "LIMIT_UNTIL"
|
||||
ignoreModeration?: boolean
|
||||
ignoreModeration?: boolean,
|
||||
window?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of notes by pubkeys
|
||||
*/
|
||||
export default function Timeline({ subject, postsOnly = false, method, ignoreModeration = false }: TimelineProps) {
|
||||
export default function Timeline({ subject, postsOnly = false, method, ignoreModeration = false, window }: TimelineProps) {
|
||||
const { muted, isMuted } = useModeration();
|
||||
const { main, related, latest, parent, loadMore, showLatest } = useTimelineFeed(subject, {
|
||||
method
|
||||
method,
|
||||
window: window
|
||||
});
|
||||
|
||||
const filterPosts = useCallback((nts: TaggedRawEvent[]) => {
|
||||
|
@ -9,7 +9,8 @@ import { RootState } from "State/Store";
|
||||
import { UserPreferences } from "State/Login";
|
||||
|
||||
export interface TimelineFeedOptions {
|
||||
method: "TIME_RANGE" | "LIMIT_UNTIL"
|
||||
method: "TIME_RANGE" | "LIMIT_UNTIL",
|
||||
window?: number
|
||||
}
|
||||
|
||||
export interface TimelineSubject {
|
||||
@ -20,7 +21,7 @@ export interface TimelineSubject {
|
||||
|
||||
export default function useTimelineFeed(subject: TimelineSubject, options: TimelineFeedOptions) {
|
||||
const now = unixNow();
|
||||
const [window] = useState<number>(60 * 60);
|
||||
const [window] = useState<number>(options.window ?? 60 * 60);
|
||||
const [until, setUntil] = useState<number>(now);
|
||||
const [since, setSince] = useState<number>(now - window);
|
||||
const [trackingEvents, setTrackingEvent] = useState<u256[]>([]);
|
||||
|
@ -45,7 +45,7 @@ export default function RootPage() {
|
||||
</div>
|
||||
</div></> : null}
|
||||
{followHints()}
|
||||
<Timeline key={tab} subject={timelineSubect} postsOnly={tab === RootTab.Posts} method={"TIME_RANGE"} />
|
||||
<Timeline key={tab} subject={timelineSubect} postsOnly={tab === RootTab.Posts} method={"TIME_RANGE"} window={tab === RootTab.Global ? 60 : undefined}/>
|
||||
<NoteCreator replyTo={undefined} autoFocus={true} show={show} setShow={setShow} />
|
||||
</>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user