Skip to content

Commit

Permalink
remove refetch messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrov-site committed May 17, 2024
1 parent c6d6f4e commit 0c35d84
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions frontend/src/components/channels/Channels.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
useGetChannelsQuery, channelsApi,
} from '../../api/channels';
import { changeChannel, setChannelModal } from '../../store/slices/appSlice';
import { useGetMessagesQuery } from '../../api/messages';
import socket from '../../socket';
import RenameChannel from '../modals/RenameChannel';
import DeleteChannel from '../modals/DeleteChannel';
Expand All @@ -20,14 +19,12 @@ const Channels = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const { data: channels = [] } = useGetChannelsQuery();
const { refetch: refetchMessages } = useGetMessagesQuery();
const currentChannelId = useSelector((state) => state.app.currentChannelId);
const getVariantButton = (channel) => (channel.id === currentChannelId ? 'secondary' : 'light');
const switchChannel = (channel) => {
const { id, name } = channel;
if (id !== currentChannelId) {
dispatch(changeChannel({ id, name }));
refetchMessages();
}
};
const handleShowModal = (modalName, channel = { id: '', name: '' }) => {
Expand Down

0 comments on commit 0c35d84

Please sign in to comment.