Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/components/pages/AdminUserManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {skipToken} from "@reduxjs/toolkit/query";
export const AdminUserManager = () => {
const dispatch = useAppDispatch();

const [searchUsers, {isUninitialized: searchNotRequested}] = useAdminSearchUsersMutation();
const [searchUsers, {isUninitialized: searchNotRequested, isLoading: searchLoading}] = useAdminSearchUsersMutation();
const searchResults = useAppSelector(selectors.admin.userSearch);
const [searchQuery, setSearchQuery] = useState<AdminSearchEndpointParams>({
postcodeRadius: "FIVE_MILES",
Expand Down Expand Up @@ -312,7 +312,7 @@ export const AdminUserManager = () => {
{/* Results */}
{!searchNotRequested &&
<ShowLoading
until={searchResults}
until={searchLoading ? undefined : searchResults}
thenRender={searchResults => {
return searchResults.length > 0 ?
<div className="overflow-auto">
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/pages/SetAssignments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ export const SetAssignments = () => {
boardTitleFilter, setBoardTitleFilter
} = useGameboards(isAda && above["lg"](deviceSize) ? BoardViews.table : BoardViews.card, BoardLimit.six);

const isGroupsEmptyState = !(groups && groups.length > 0);
const isBoardsEmptyState = !(boards && boards.boards?.length > 0);
const isGroupsEmptyState = groups && groups.length === 0;
const isBoardsEmptyState = boards && boards.boards?.length === 0;
const switchView = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
setBoardView(e.target.value as BoardViews);
}, [setBoardView]);
Expand Down Expand Up @@ -438,9 +438,9 @@ export const SetAssignments = () => {
<h3>Your quizzes</h3>
<div
className={classNames("mb-4", "d-flex", "flex-column", "flex-lg-row", "align-items-center", {"justify-content-start": isBoardsEmptyState}, {"justify-content-between": !isBoardsEmptyState})}>
{!(boards && boards.totalResults === 0) &&
{boards && boards.totalResults > 0 &&
<div>
<p className={"d-none d-lg-block my-auto"}>{`You have ${boards?.boards.length} created quiz${boards && boards.boards?.length > 1 ? "zes" : ""}.`}</p>
<p className={"d-none d-lg-block my-auto"}>{`You have ${boards.boards.length} created quiz${boards.boards.length > 1 ? "zes" : ""}.`}</p>
</div>
}
<div className={"w-100 w-lg-auto"}>
Expand Down