mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
move useBufferedFeeds to Home
This commit is contained in:
@@ -50,7 +50,7 @@ const Post = ({ content, postQuoteOnClick, postQuoteOnOver, postQuoteOnLeave, po
|
||||
|
||||
const regex = new RegExp(`${patternC}|${patternPC}|${patternU}|${patternP}`, 'g');
|
||||
|
||||
return children.flatMap((child, i) => {
|
||||
return children?.flatMap((child, i) => {
|
||||
if (typeof child !== 'string') {
|
||||
return child;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { Fragment, useEffect, useRef } from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
import { useAccount } from '@plebbit/plebbit-react-hooks';
|
||||
import { useAccount, useBufferedFeeds } from '@plebbit/plebbit-react-hooks';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { Container, Header, Logo, Page, Search, About, AboutTitle, AboutContent, Boards, BoardsTitle, BoardsContent, Footer } from '../styled/views/Home.styled';
|
||||
import BoardAvatar from '../BoardAvatar';
|
||||
@@ -29,6 +29,16 @@ const Home = () => {
|
||||
const prevStyle = useRef(selectedStyle);
|
||||
const prevBodyStyle = useRef(bodyStyle);
|
||||
|
||||
// preload default subs and subscriptions
|
||||
useBufferedFeeds({
|
||||
feedsOptions: [
|
||||
{subplebbitAddresses: defaultSubplebbits.map(
|
||||
(subplebbit) => subplebbit.address
|
||||
), sortType: 'active'},
|
||||
{subplebbitAddresses: account?.subscriptions, sortType: 'active'}
|
||||
]
|
||||
});
|
||||
|
||||
// prevent dark mode
|
||||
useEffect(() => {
|
||||
const currentPrevStyle = prevStyle.current;
|
||||
|
||||
Reference in New Issue
Block a user