remove delay before showing "show more posts" button

This commit is contained in:
Tom (plebeius.eth)
2024-12-08 10:48:54 +01:00
parent 06e8a323d8
commit 0022e7907f
2 changed files with 2 additions and 22 deletions

View File

@@ -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}>

View File

@@ -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}>