mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(home): fix displacement of threads while rendered in popular threads box
This commit is contained in:
@@ -105,12 +105,14 @@ const Home = () => {
|
||||
});
|
||||
|
||||
const newSfwListCids = Object.values(subplebbitToCid)
|
||||
.sort((a, b) => b.timestamp - a.timestamp)
|
||||
.map((item) => item.cid)
|
||||
.slice(0, 8);
|
||||
|
||||
setSfwListCids(newSfwListCids);
|
||||
}, [sfwSubs.subplebbits]);
|
||||
setSfwListCids((prevOrderedCids) => {
|
||||
const uniqueCids = Array.from(new Set([...prevOrderedCids, ...newSfwListCids]));
|
||||
return uniqueCids.slice(0, 8);
|
||||
});
|
||||
}, [sfwSubs.subplebbits, sfwListCids]);
|
||||
|
||||
const account = useAccount();
|
||||
const navigate = useNavigate();
|
||||
|
||||
Reference in New Issue
Block a user