feat(p/all): add description view

This commit is contained in:
plebeius.eth
2024-05-17 17:25:25 +02:00
parent b07a06fa12
commit 09f05ac8a0
7 changed files with 60 additions and 29 deletions
+3 -3
View File
@@ -78,15 +78,15 @@ const Board = () => {
const setLastVirtuosoState = () => {
virtuosoRef.current?.getState((snapshot: StateSnapshot) => {
if (snapshot?.ranges?.length) {
lastVirtuosoStates[subplebbitAddress + sortType] = snapshot;
lastVirtuosoStates[location.pathname] = snapshot;
}
});
};
window.addEventListener('scroll', setLastVirtuosoState);
return () => window.removeEventListener('scroll', setLastVirtuosoState);
}, [subplebbitAddress, sortType]);
}, [location.pathname]);
const lastVirtuosoState = lastVirtuosoStates?.[subplebbitAddress + sortType];
const lastVirtuosoState = lastVirtuosoStates?.[location.pathname];
useEffect(() => {
document.title = title ? title : shortAddress;