fix: updated logic to show sidebar

This commit is contained in:
AhtishamShahid
2022-12-01 12:13:31 +05:00
committed by Ahtisham Shahid
parent 545b69376f
commit ad3346ea09
2 changed files with 3 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ export const useSidebarVisible = () => {
return true;
}
if (isViewingTopics || isViewingLearners) {
if ((isViewingTopics || isViewingLearners) && totalThreads > 0) {
return true;
}

View File

@@ -21,6 +21,7 @@ import {
import { fetchThreads } from './data/thunks';
import NoResults from './NoResults';
import { PostLink } from './post';
import { selectTopicFilter } from '../topics/data/selectors';
function PostsList({
posts, topics, intl, isTopicTab,
@@ -88,6 +89,7 @@ function PostsList({
<>
{postInstances(pinnedPosts)}
{postInstances(unpinnedPosts)}
{posts?.length === 0 && loadingStatus === RequestStatus.SUCCESSFUL && <NoResults />}
{loadingStatus === RequestStatus.IN_PROGRESS ? (
<div className="d-flex justify-content-center p-4">
<Spinner animation="border" variant="primary" size="lg" />