Merge pull request #128 from Empty2k12/fix/no-public-rooms
Improve message when there are no public rooms on a server
This commit is contained in:
commit
0f02bfd2c3
1 changed files with 8 additions and 2 deletions
|
@ -139,14 +139,20 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
|
|||
updateIsViewMore(false);
|
||||
if (totalRooms.length === 0) {
|
||||
updateSearchQuery({
|
||||
error: `No result found for "${inputRoomName}" on ${inputHs}`,
|
||||
error: inputRoomName === ''
|
||||
? `No public rooms on ${inputHs}`
|
||||
: `No result found for "${inputRoomName}" on ${inputHs}`,
|
||||
alias: isInputAlias ? inputRoomName : null,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
updatePublicRooms([]);
|
||||
let err = 'Something went wrong!';
|
||||
if (e?.httpStatus >= 400 && e?.httpStatus < 500) {
|
||||
err = e.message;
|
||||
}
|
||||
updateSearchQuery({
|
||||
error: 'Something went wrong!',
|
||||
error: err,
|
||||
alias: isInputAlias ? inputRoomName : null,
|
||||
});
|
||||
updateIsSearching(false);
|
||||
|
|
Loading…
Reference in a new issue