Skip to content

Commit

Permalink
Merge pull request #759 from sparcs-kaist/#758-mypage-open-channeltal…
Browse files Browse the repository at this point in the history
…k-on-query

#758 특정 쿼리에서 채널톡 창 열기
  • Loading branch information
predict-woo authored Mar 26, 2024
2 parents d44b42e + e2cd493 commit 59a4da4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class ChannelService {
shutdown() {
window.ChannelIO("shutdown");
}
showMessenger() {
window.ChannelIO("showMessenger");
}
}

export default new ChannelService();
13 changes: 12 additions & 1 deletion packages/web/src/pages/Mypage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useCallback, useState } from "react";
import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";

import channelService from "@/hooks/skeleton/useChannelTalkEffect/channelService";
import { useValueRecoilState } from "@/hooks/useFetchRecoilState";

import AdaptiveDiv from "@/components/AdaptiveDiv";
Expand Down Expand Up @@ -43,6 +45,15 @@ const Mypage = () => {
const [isOpenEventPolicy, setIsOpenEventPolicy] = useState(false);
const [isOpenMembers, setOpenIsMembers] = useState(false);

const { search } = useLocation();

useEffect(() => {
const channeltalk = new URLSearchParams(search).get("channeltalk");
if (channeltalk === "true") {
channelService.showMessenger();
}
}, [search]);

const onClickProfileModify = useCallback(
() => setIsOpenProfileModify(true),
[]
Expand Down

0 comments on commit 59a4da4

Please sign in to comment.