mirror of
https://github.com/plebbit/seedit.git
synced 2026-05-24 00:29:58 -04:00
remove delay before showing "show more posts" button
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { Link, useParams } from 'react-router-dom';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { useFeed } from '@plebbit/plebbit-react-hooks';
|
||||
@@ -38,15 +38,6 @@ const All = () => {
|
||||
|
||||
const currentTimeFilterName = params.timeFilterName || timeFilterName;
|
||||
|
||||
const [showMorePostsSuggestion, setShowMorePostsSuggestion] = useState(false);
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setShowMorePostsSuggestion(true);
|
||||
}, 5000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
const documentTitle = _.capitalize(t('all')) + ' - Seedit';
|
||||
useEffect(() => {
|
||||
document.title = documentTitle;
|
||||
@@ -71,7 +62,6 @@ const All = () => {
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
showMorePostsSuggestion &&
|
||||
monthlyFeed.length > feed.length &&
|
||||
(weeklyFeed.length > feed.length ? (
|
||||
<div className={styles.morePostsSuggestion}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { Link, useParams } from 'react-router-dom';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { useFeed } from '@plebbit/plebbit-react-hooks';
|
||||
@@ -43,15 +43,6 @@ const Home = () => {
|
||||
|
||||
const currentTimeFilterName = params.timeFilterName || timeFilterName;
|
||||
|
||||
const [showMorePostsSuggestion, setShowMorePostsSuggestion] = useState(false);
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setShowMorePostsSuggestion(true);
|
||||
}, 5000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
const Footer = () => {
|
||||
let footerContent;
|
||||
if (feed.length === 0) {
|
||||
@@ -70,7 +61,6 @@ const Home = () => {
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
showMorePostsSuggestion &&
|
||||
monthlyFeed.length > feed.length &&
|
||||
(weeklyFeed.length > feed.length ? (
|
||||
<div className={styles.morePostsSuggestion}>
|
||||
|
||||
Reference in New Issue
Block a user