diff --git a/app/javascript/chat/channels.jsx b/app/javascript/chat/channels.jsx index 310366c59..79ea0a6a3 100644 --- a/app/javascript/chat/channels.jsx +++ b/app/javascript/chat/channels.jsx @@ -28,6 +28,9 @@ const Channels = ({ channel={channel} discoverableChannel triggerActiveContent={triggerActiveContent} + isActiveChannel={ + parseInt(activeChannelId, 10) === channel.chat_channel_id + } /> ); }, diff --git a/app/javascript/chat/chat.jsx b/app/javascript/chat/chat.jsx index d5deda3dd..1600a8d2c 100644 --- a/app/javascript/chat/chat.jsx +++ b/app/javascript/chat/chat.jsx @@ -146,6 +146,9 @@ export default class Chat extends Component { searchType: '', paginationNumber: channelPaginationNum, }; + if (activeChannelId !== null) { + searchParams.searchType = 'discoverable'; + } getChannels(searchParams, filters, this.loadChannels); getUnopenedChannelIds(this.markUnopenedChannelIds); } diff --git a/app/javascript/chat/components/channelButton.jsx b/app/javascript/chat/components/channelButton.jsx index 42422b0b2..24e8aa55b 100644 --- a/app/javascript/chat/components/channelButton.jsx +++ b/app/javascript/chat/components/channelButton.jsx @@ -1,81 +1,97 @@ -import { h } from 'preact'; +import { h, Component, createRef } from 'preact'; import PropTypes from 'prop-types'; -const ChannelButton = ({ - channel, - handleSwitchChannel, - otherClassname, - newMessagesIndicator, - isUnopened, - discoverableChannel, - triggerActiveContent, -}) => { - return ( - - ); -}; + + ); + } +} ChannelButton.propTypes = { channel: PropTypes.shape({