File tree Expand file tree Collapse file tree
apps/mobile/src/features/projects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -972,16 +972,26 @@ export function AddProjectDestinationScreen(props: {
972972 if ( AsyncResult . isFailure ( startResult ) ) {
973973 setError ( errorMessage ( Cause . squash ( startResult . cause ) ) ) ;
974974 } else {
975- // The create event usually lands before the RPC returns; give the
976- // shell stream a moment so the draft opens on the new project rather
977- // than falling back to its picker.
978- await waitForProject ( { environmentId : environment . environmentId , projectId } , 3_000 ) ;
979- openNewTaskDraft ( navigation , {
980- environmentId : environment . environmentId ,
981- projectId,
982- title,
983- cloning : "1" ,
984- } ) ;
975+ // The draft screen resolves its project from the client store, so it
976+ // must not open before the create event has arrived (it would fall
977+ // back to the project picker and lose the clone controls). Stay in
978+ // the submitting state until then; the clone keeps running either way.
979+ const project = await waitForProject (
980+ { environmentId : environment . environmentId , projectId } ,
981+ 15_000 ,
982+ ) ;
983+ if ( project === null ) {
984+ setError (
985+ "The project was created but has not reached this device yet. It will appear in the project list once the connection catches up." ,
986+ ) ;
987+ } else {
988+ openNewTaskDraft ( navigation , {
989+ environmentId : environment . environmentId ,
990+ projectId,
991+ title,
992+ cloning : "1" ,
993+ } ) ;
994+ }
985995 }
986996 setIsSubmitting ( false ) ;
987997 return ;
You can’t perform that action at this time.
0 commit comments