From 0022e7907fb7349fd71f73a2e1fe22ba4f84aa03 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 8 Dec 2024 10:48:54 +0100 Subject: [PATCH] remove delay before showing "show more posts" button --- src/views/all/all.tsx | 12 +----------- src/views/home/home.tsx | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/views/all/all.tsx b/src/views/all/all.tsx index 4881283a..eb83301d 100644 --- a/src/views/all/all.tsx +++ b/src/views/all/all.tsx @@ -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 = () => { /> ) : ( - showMorePostsSuggestion && monthlyFeed.length > feed.length && (weeklyFeed.length > feed.length ? (
diff --git a/src/views/home/home.tsx b/src/views/home/home.tsx index f139140b..3828c5b6 100644 --- a/src/views/home/home.tsx +++ b/src/views/home/home.tsx @@ -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 = () => { />
) : ( - showMorePostsSuggestion && monthlyFeed.length > feed.length && (weeklyFeed.length > feed.length ? (