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);
|
updateIsViewMore(false);
|
||||||
if (totalRooms.length === 0) {
|
if (totalRooms.length === 0) {
|
||||||
updateSearchQuery({
|
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,
|
alias: isInputAlias ? inputRoomName : null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
updatePublicRooms([]);
|
updatePublicRooms([]);
|
||||||
|
let err = 'Something went wrong!';
|
||||||
|
if (e?.httpStatus >= 400 && e?.httpStatus < 500) {
|
||||||
|
err = e.message;
|
||||||
|
}
|
||||||
updateSearchQuery({
|
updateSearchQuery({
|
||||||
error: 'Something went wrong!',
|
error: err,
|
||||||
alias: isInputAlias ? inputRoomName : null,
|
alias: isInputAlias ? inputRoomName : null,
|
||||||
});
|
});
|
||||||
updateIsSearching(false);
|
updateIsSearching(false);
|
||||||
|
|
Loading…
Reference in a new issue