@@ -3,7 +3,7 @@ import { showToast } from "@/utils/toast"
33import { base64Encode } from "@opencode-ai/core/util/encode"
44import { Binary } from "@opencode-ai/core/util/binary"
55import { useNavigate , useParams , useSearchParams } from "@solidjs/router"
6- import { batch , type Accessor } from "solid-js"
6+ import { batch , startTransition , type Accessor } from "solid-js"
77import { useTabs } from "@/context/tabs"
88import { useServerSync , type ServerSync } from "@/context/server-sync"
99import { useLanguage } from "@/context/language"
@@ -374,13 +374,16 @@ export function createPromptSubmit(input: PromptSubmitInput) {
374374 if ( created ) {
375375 seed ( sessionDirectory , created )
376376 session = created
377- if ( shouldAutoAccept ) permission . enableAutoAccept ( session . id , sessionDirectory )
378- local . session . promote ( sessionDirectory , session . id )
379- layout . handoff . setTabs ( base64Encode ( sessionDirectory ) , session . id )
380- const draftID = search . draftId
381- if ( draftID ) tabs . promoteDraft ( draftID , { server : tabs . draft ( draftID ) . server , sessionId : session . id } )
382- else navigate ( `/${ base64Encode ( sessionDirectory ) } /session/${ session . id } ` )
383- submission . retarget ( prompt . capture ( { dir : base64Encode ( sessionDirectory ) , id : session . id } ) )
377+ await startTransition ( ( ) => {
378+ if ( ! session ) return
379+ if ( shouldAutoAccept ) permission . enableAutoAccept ( session . id , sessionDirectory )
380+ local . session . promote ( sessionDirectory , session . id )
381+ layout . handoff . setTabs ( base64Encode ( sessionDirectory ) , session . id )
382+ const draftID = search . draftId
383+ if ( draftID ) tabs . promoteDraft ( draftID , { server : tabs . draft ( draftID ) . server , sessionId : session . id } )
384+ else navigate ( `/${ base64Encode ( sessionDirectory ) } /session/${ session . id } ` )
385+ submission . retarget ( prompt . capture ( { dir : base64Encode ( sessionDirectory ) , id : session . id } ) )
386+ } )
384387 }
385388 }
386389 if ( ! session ) {
0 commit comments