File tree Expand file tree Collapse file tree
platform/app/(shell)/home/_components/home-conversation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,9 +36,11 @@ export function HomeConversation({ requestMode }: HomeConversationProps) {
3636 modes : [ ...SEARCH_MODES ] ,
3737 changeMode : ( mode ) => {
3838 if ( mode !== 'search' ) return
39- const { pathname } = window . location
40- const chatPath = pathname . startsWith ( `${ routes . search } /chat/` ) ? pathname : routes . search
41- router . push ( `${ chatPath } ?mode=search` )
39+ const current = new URL ( window . location . href )
40+ const onChat = current . pathname . startsWith ( `${ routes . search } /chat/` )
41+ const params = new URLSearchParams ( onChat ? current . search : '' )
42+ params . set ( 'mode' , 'search' )
43+ router . push ( `${ onChat ? current . pathname : routes . search } ?${ params } ` )
4244 } ,
4345 newLabel : 'New chat' ,
4446 canStartNew : true ,
Original file line number Diff line number Diff line change @@ -1361,7 +1361,7 @@ async function homeChecks() {
13611361 await composer ( page ) . fill ( 'Say hello again from Home' )
13621362 await composer ( page ) . press ( 'Enter' )
13631363 await expect ( page ) . toHaveURL ( / \/ s e a r c h \/ c h a t \/ [ ^ / ? ] + / , { timeout : 30_000 } )
1364- await page . getByRole ( 'button' , { name : 'New chat' } ) . click ( )
1364+ await page . getByRole ( 'button' , { name : 'New chat' , exact : true } ) . click ( )
13651365 await expect ( page ) . toHaveURL ( / \/ h o m e $ / )
13661366 await expect ( composer ( page ) ) . toHaveValue ( '' )
13671367 } )
You can’t perform that action at this time.
0 commit comments