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
+4 -2
View File
@@ -538,9 +538,10 @@ 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
) : ( ) : (
feed.length > 1 ? (
<Virtuoso <Virtuoso
increaseViewportBy={2000} increaseViewportBy={2000}
data={selectedFeed} data={selectedFeed}
@@ -1173,6 +1174,7 @@ const Board = () => {
useWindowScroll={true} useWindowScroll={true}
components={{ Footer: hasMore ? () => <PostLoader /> : null }} components={{ Footer: hasMore ? () => <PostLoader /> : null }}
/> />
) : (<PostLoader />)
)} )}
</div> </div>
</BoardForm> </BoardForm>
+4 -2
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,6 +518,7 @@ const Catalog = () => {
</Link> </Link>
)})} )})}
</InfiniteScroll> </InfiniteScroll>
) : (<CatalogLoader />)
)} )}
</Threads> </Threads>
<Footer selectedStyle={selectedStyle}> <Footer selectedStyle={selectedStyle}>