Skip to content

Commit 906cc4b

Browse files
authored
Merge pull request #232 from Soohyuniii/feat/친구-채팅-제목에-이름-띄우기
Feat/친구 채팅 제목에 이름 띄우기
2 parents f15b3f5 + d235bac commit 906cc4b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ const PageTracker = () => {
7171
const App = () => {
7272
useEffect(() => {
7373
initGA();
74-
console.log("init");
7574
}, []);
7675

7776
return (

src/components/Profile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const Profile = ({ info, deleteIndex, setVirtualFriendList }: ProfileProps) => {
3030
state: {
3131
mode: "virtualFriend",
3232
mbti: info.mbti,
33-
id: info.virtualFriendId
33+
id: info.virtualFriendId,
34+
name: info.virtualFriendName
3435
}
3536
});
3637
};

src/pages/Chat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ interface ChatResponse {
2020

2121
const Chat = () => {
2222
const { state } = useLocation();
23-
const { mbti, mode, id = Date.now().toString() } = state;
23+
const { mbti, mode, id = Date.now().toString(), name } = state;
2424

2525
const [messages, setMessages] = useState<Message[]>([]);
2626
const [input, setInput] = useState("");
2727
const [isOpen, setIsOpen] = useState(false);
2828
const bottomRef = useRef<HTMLDivElement | null>(null);
2929

30-
const chatTitle = `${mbti}와 대화`;
30+
const chatTitle = mode === "fastFriend" ? `${mbti} 대화` : `${name} 대화`;
3131
const assistantInfo = mbti;
3232
const assistantImgUrl = pickMbtiImage(assistantInfo);
3333
const storageKey = `chatMessages_${id}`;

src/pages/SelectInfo.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ const SelectInfo = () => {
207207
state: {
208208
mbti,
209209
mode: type,
210-
id: responseData.conversationId
210+
id: responseData.conversationId,
211+
name: responseData.virtualFriendName
211212
}
212213
});
213214
} else if (type === "fastFriend" && typeof responseData === "number") {

0 commit comments

Comments
 (0)