fix disable skeleton if state is failed

This commit is contained in:
Tom
2023-05-09 16:30:02 +02:00
parent 2aff229997
commit 4d43b190df
2 changed files with 11 additions and 7 deletions
+6 -4
View File
@@ -538,10 +538,11 @@ const Board = () => {
<Tooltip id="tooltip" className="tooltip" /> <Tooltip id="tooltip" className="tooltip" />
<BoardForm selectedStyle={selectedStyle}> <BoardForm selectedStyle={selectedStyle}>
<div className="board"> <div className="board">
{feed.length < 1 ? ( {subplebbit?.state === "failed" ? (
<PostLoader /> null
) : ( ) : (
<Virtuoso feed.length > 1 ? (
<Virtuoso
increaseViewportBy={2000} increaseViewportBy={2000}
data={selectedFeed} data={selectedFeed}
itemContent={(index, thread) => { itemContent={(index, thread) => {
@@ -1172,7 +1173,8 @@ const Board = () => {
endReached={tryLoadMore} endReached={tryLoadMore}
useWindowScroll={true} useWindowScroll={true}
components={{ Footer: hasMore ? () => <PostLoader /> : null }} components={{ Footer: hasMore ? () => <PostLoader /> : null }}
/> />
) : (<PostLoader />)
)} )}
</div> </div>
</BoardForm> </BoardForm>
+5 -3
View File
@@ -452,9 +452,10 @@ const Catalog = () => {
</TopBar> </TopBar>
<Tooltip id="tooltip" className="tooltip" /> <Tooltip id="tooltip" className="tooltip" />
<Threads selectedStyle={selectedStyle}> <Threads selectedStyle={selectedStyle}>
{feed.length < 1 ? ( {subplebbit?.state === "failed" ? (
<CatalogLoader /> null
) : ( ) : (
feed.length > 1 ? (
<InfiniteScroll <InfiniteScroll
pageStart={0} pageStart={0}
loadMore={tryLoadMore} loadMore={tryLoadMore}
@@ -517,7 +518,8 @@ const Catalog = () => {
</Link> </Link>
)})} )})}
</InfiniteScroll> </InfiniteScroll>
)} ) : (<CatalogLoader />)
)}
</Threads> </Threads>
<Footer selectedStyle={selectedStyle}> <Footer selectedStyle={selectedStyle}>
<Break id="break" selectedStyle={selectedStyle} style={{ <Break id="break" selectedStyle={selectedStyle} style={{