Skip to content

Commit

Permalink
Show spinner whilst initial search request is in progress (#12883)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Aug 12, 2024
1 parent 239330b commit 0e37c09
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/views/rooms/RoomSearchAuxPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { _t } from "../../../languageHandler";
import { PosthogScreenTracker } from "../../../PosthogTrackers";
import SearchWarning, { WarningKind } from "../elements/SearchWarning";
import { SearchInfo, SearchScope } from "../../../Searching";
import InlineSpinner from "../elements/InlineSpinner";

interface Props {
searchInfo?: SearchInfo;
Expand All @@ -41,13 +42,15 @@ const RoomSearchAuxPanel: React.FC<Props> = ({ searchInfo, isRoomEncrypted, onSe
<div className="mx_RoomSearchAuxPanel_summary">
<SearchIcon width="24px" height="24px" />
<div className="mx_RoomSearchAuxPanel_summary_text">
{searchInfo
? _t(
"room|search|summary",
{ count: searchInfo.count ?? 0 },
{ query: () => <b>{searchInfo.term}</b> },
)
: undefined}
{searchInfo?.count !== undefined ? (
_t(
"room|search|summary",
{ count: searchInfo.count },
{ query: () => <b>{searchInfo.term}</b> },
)
) : (
<InlineSpinner />
)}
<SearchWarning kind={WarningKind.Search} isRoomEncrypted={isRoomEncrypted} showLogo={false} />
</div>
</div>
Expand Down

0 comments on commit 0e37c09

Please sign in to comment.