feat: lots updates

This commit is contained in:
zerosoul
2022-01-30 21:30:12 +08:00
parent e18c7323a6
commit ceb02d834f
38 changed files with 1943 additions and 1832 deletions
@@ -7,7 +7,6 @@ import ChannelIcon from "../ChannelIcon";
import Contact from "../Contact";
import StyledWrapper from "./styled";
import useFilteredUsers from "../../hook/useFilteredUsers";
import { useGetChannelsQuery } from "../../../app/services/channel";
import { useCreateChannelMutation } from "../../../app/services/channel";
export default function ChannelModal({ personal = false, closeModal }) {
@@ -19,7 +18,6 @@ export default function ChannelModal({ personal = false, closeModal }) {
is_public: !personal,
});
const { contacts, input, updateInput } = useFilteredUsers();
const { refetch: refetchChannels } = useGetChannelsQuery();
const [
createChannel,
{ isSuccess, isError, isLoading, data: newChannel },
@@ -49,7 +47,6 @@ export default function ChannelModal({ personal = false, closeModal }) {
if (isSuccess) {
toast.success("create new channel success");
closeModal();
refetchChannels();
navigateTo(`/chat/channel/${newChannel.gid}`);
}
}, [isSuccess, newChannel]);