mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Update catalog.tsx
This commit is contained in:
@@ -63,7 +63,6 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp
|
|||||||
return _feed;
|
return _feed;
|
||||||
}, [feed, description, rules, address, isFeedLoaded, createdAt, title, shortAddress, avatarUrl, t, isInAllView, multisub, includeDescriptionAndRules]);
|
}, [feed, description, rules, address, isFeedLoaded, createdAt, title, shortAddress, avatarUrl, t, isInAllView, multisub, includeDescriptionAndRules]);
|
||||||
|
|
||||||
// Memoize rows calculation, ensuring it updates on changes to the modified feed or column count
|
|
||||||
const rows = useMemo(() => {
|
const rows = useMemo(() => {
|
||||||
const rows = [];
|
const rows = [];
|
||||||
for (let i = 0; i < feedWithDescriptionAndRules.length; i += columnCount) {
|
for (let i = 0; i < feedWithDescriptionAndRules.length; i += columnCount) {
|
||||||
@@ -178,6 +177,9 @@ const Catalog = () => {
|
|||||||
{location.pathname.endsWith('/settings') && <SettingsModal />}
|
{location.pathname.endsWith('/settings') && <SettingsModal />}
|
||||||
<hr />
|
<hr />
|
||||||
<div className={styles.catalog}>
|
<div className={styles.catalog}>
|
||||||
|
{showBlockedComments ? (
|
||||||
|
rows.map((row, index) => <CatalogRow key={index} index={index} row={row} />)
|
||||||
|
) : (
|
||||||
<Virtuoso
|
<Virtuoso
|
||||||
increaseViewportBy={{ bottom: 1200, top: 1200 }}
|
increaseViewportBy={{ bottom: 1200, top: 1200 }}
|
||||||
totalCount={rows?.length || 0}
|
totalCount={rows?.length || 0}
|
||||||
@@ -190,6 +192,7 @@ const Catalog = () => {
|
|||||||
restoreStateFrom={lastVirtuosoState}
|
restoreStateFrom={lastVirtuosoState}
|
||||||
initialScrollTop={lastVirtuosoState?.scrollTop}
|
initialScrollTop={lastVirtuosoState?.scrollTop}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user