join channel with alias bug fixed

This commit is contained in:
unknown 2021-08-11 16:48:39 +05:30
parent c9b1a062ce
commit 80d4a2b242

View file

@ -53,7 +53,7 @@ function TryJoinWithAlias({ alias, onRequestClose }) {
} catch (e) { } catch (e) {
setStatus({ setStatus({
isJoining: false, isJoining: false,
error: `Unable to join ${alias}. Either room is private or doesn't exist.`, error: `Unable to join ${alias}. Either channel is private or doesn't exist.`,
roomId: null, roomId: null,
tempRoomId: null, tempRoomId: null,
}); });
@ -145,7 +145,10 @@ function PublicChannels({ isOpen, searchTerm, onRequestClose }) {
} }
} catch (e) { } catch (e) {
updatePublicChannels([]); updatePublicChannels([]);
updateSearchQuery({ error: 'Something went wrong!' }); updateSearchQuery({
error: 'Something went wrong!',
alias: isInputAlias ? inputChannelName : null,
});
updateIsSearching(false); updateIsSearching(false);
updateNextBatch(undefined); updateNextBatch(undefined);
updateIsViewMore(false); updateIsViewMore(false);
@ -247,7 +250,7 @@ function PublicChannels({ isOpen, searchTerm, onRequestClose }) {
{ searchQuery.error && ( { searchQuery.error && (
<> <>
<Text className="public-channels__search-error" variant="b2">{searchQuery.error}</Text> <Text className="public-channels__search-error" variant="b2">{searchQuery.error}</Text>
{searchQuery.alias !== null && ( {typeof searchQuery.alias === 'string' && (
<TryJoinWithAlias onRequestClose={onRequestClose} alias={searchQuery.alias} /> <TryJoinWithAlias onRequestClose={onRequestClose} alias={searchQuery.alias} />
)} )}
</> </>