Improve message when there are no public rooms on a server
This commit is contained in:
parent
83c6914a50
commit
7d032bb684
1 changed files with 10 additions and 2 deletions
|
@ -137,7 +137,7 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
|
||||||
updateNextBatch(result.next_batch);
|
updateNextBatch(result.next_batch);
|
||||||
updateIsSearching(false);
|
updateIsSearching(false);
|
||||||
updateIsViewMore(false);
|
updateIsViewMore(false);
|
||||||
if (totalRooms.length === 0) {
|
if (totalRooms.length === 0 && inputRoomName !== '') {
|
||||||
updateSearchQuery({
|
updateSearchQuery({
|
||||||
error: `No result found for "${inputRoomName}" on ${inputHs}`,
|
error: `No result found for "${inputRoomName}" on ${inputHs}`,
|
||||||
alias: isInputAlias ? inputRoomName : null,
|
alias: isInputAlias ? inputRoomName : null,
|
||||||
|
@ -241,12 +241,20 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typeof searchQuery.name !== 'undefined' && !isSearching && (
|
typeof searchQuery.name !== 'undefined' && !isSearching && publicRooms.length !== 0 && (
|
||||||
searchQuery.name === ''
|
searchQuery.name === ''
|
||||||
? <Text variant="b2">{`Public rooms on ${searchQuery.homeserver}.`}</Text>
|
? <Text variant="b2">{`Public rooms on ${searchQuery.homeserver}.`}</Text>
|
||||||
: <Text variant="b2">{`Search result for "${searchQuery.name}" on ${searchQuery.homeserver}.`}</Text>
|
: <Text variant="b2">{`Search result for "${searchQuery.name}" on ${searchQuery.homeserver}.`}</Text>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
typeof searchQuery.name !== 'undefined' && !isSearching && publicRooms.length === 0
|
||||||
|
&& (
|
||||||
|
<div className="flex--center">
|
||||||
|
<Text variant="b2">{`There are no public rooms on ${searchQuery.homeserver}.`}</Text>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
{ searchQuery.error && (
|
{ searchQuery.error && (
|
||||||
<>
|
<>
|
||||||
<Text className="public-rooms__search-error" variant="b2">{searchQuery.error}</Text>
|
<Text className="public-rooms__search-error" variant="b2">{searchQuery.error}</Text>
|
||||||
|
|
Loading…
Reference in a new issue