File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export default function ProfilePage() {
9797 </ div >
9898 < div className = "-mt-20 z-10" >
9999 < Image
100- src = { '/userProfile/' + user . profileImage + '.png' || `/userProfile/1.png` }
100+ src = { '/userProfile/' + ( parseInt ( user . profileImage ) + 1 ) + '.png' || `/userProfile/1.png` }
101101 alt = "profile"
102102 width = { 150 }
103103 height = { 150 }
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import remarkGfm from 'remark-gfm';
44import remarkMath from 'remark-math' ;
55import rehypeKatex from 'rehype-katex' ;
66import 'katex/dist/katex.min.css' ;
7+ import { useAuth } from '@/contexts/AuthContext' ;
78
89export default function ChatMessages ( { chatList } ) {
10+ const { user } = useAuth ( ) ;
911 const handleCopyText = ( text ) => {
1012 navigator . clipboard . writeText ( text ) ;
1113 alert ( "Copied to clipboard" ) ;
@@ -64,7 +66,7 @@ export default function ChatMessages({ chatList }) {
6466 { chatList . map ( ( message , index ) => (
6567 < div key = { index } className = { `flex mb-7 ${ message . sender === 'USER' ? 'justify-end' : 'justify-start' } ` } >
6668 < div className = "flex flex-row" >
67- < Image src = { message . sender === 'USER' ? '/icon/ user.png' : '/icon/ai.png' } alt = "user" width = { 24 } height = { 24 } className = "w-10 h-10 rounded-lg z-10" />
69+ < Image src = { message . sender === 'USER' ? '/userProfile/' + ( parseInt ( user . profileImage ) + 1 ) + ' .png' : '/icon/ai.png' } alt = "user" width = { 24 } height = { 24 } className = "w-10 h-10 rounded-lg z-10" />
6870 < div className = "flex flex-col ml-2 max-w-full" >
6971 < div className = "text-xs font-semibold" > { message . sender } </ div >
7072 < div className = { `flex flex-col text-xs rounded-2xl pr-4 pl-7 py-5 -ml-5 ${ message . sender === 'USER' ? 'items-end bg-[#4b4f5b]' : 'items-start bg-[#28303F]' } ` } >
Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ export default function Chatlist() {
2929 localStorage . setItem ( "lastChattingId" , "" ) ;
3030 setLastViewedChatId ( "" ) ;
3131 setCurrentChatId ( null ) ;
32- router . push ( '/chat' ) ;
32+ if ( window . location . pathname === '/chat' ) {
33+ window . location . reload ( ) ;
34+ } else {
35+ router . push ( '/chat' ) ;
36+ }
3337 } ;
3438
3539 if ( loading ) {
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export function AuthProvider({ children }) {
4343 const logout = ( ) => {
4444 setUser ( null ) ;
4545 localStorage . removeItem ( 'user' ) ;
46+ localStorage . removeItem ( 'lastChattingId' ) ;
4647 console . log ( '✅ 사용자 정보 삭제' ) ;
4748 document . cookie = "jwtToken=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;" ;
4849 router . push ( '/' ) ;
You can’t perform that action at this time.
0 commit comments