@@ -87,6 +87,7 @@ import { sourceControlClients } from "@t3tools/client-runtime/source-control-cli
8787import { ThemedSwitch } from "../../components/ui/ThemedSwitch" ;
8888import { uuidv4 } from "../../lib/uuid" ;
8989import { useAtomCommand } from "../../state/use-atom-command" ;
90+ import { suggestAppAccessForRemote } from "./suggestAppAccess" ;
9091import { useAtomQueryRunner } from "../../state/use-atom-query-runner" ;
9192import {
9293 useRemoteConnectionStatus ,
@@ -997,6 +998,10 @@ export function AddProjectNewScreen(props: { readonly environmentId?: string | s
997998 ) ;
998999 const environment = resolveAddProjectEnvironment ( environmentOptions , selectedEnvironmentId ) ;
9991000 const createNew = useAtomCommand ( projectEnvironment . createNew , { reportFailure : false } ) ;
1001+ const checkPublishedAppAccess = useAtomCommand ( sourceControlEnvironment . checkAppAccess , {
1002+ reportFailure : false ,
1003+ reportDefect : false ,
1004+ } ) ;
10001005 const publishRepository = useAtomCommand ( sourceControlEnvironment . publishRepository , {
10011006 reportFailure : false ,
10021007 } ) ;
@@ -1095,6 +1100,12 @@ export function AddProjectNewScreen(props: { readonly environmentId?: string | s
10951100 `Could not create the ${ publishTarget . definition . label } repository` ,
10961101 errorMessage ( Cause . squash ( publishResult . cause ) ) ,
10971102 ) ;
1103+ } else {
1104+ void suggestAppAccessForRemote (
1105+ checkPublishedAppAccess ,
1106+ environment . environmentId ,
1107+ publishResult . value . remoteUrl ,
1108+ ) ;
10981109 }
10991110 } ) ;
11001111 }
@@ -1315,6 +1326,10 @@ export function AddProjectDestinationScreen(props: {
13151326 const startProjectClone = useAtomCommand ( sourceControlEnvironment . startProjectClone , {
13161327 reportFailure : false ,
13171328 } ) ;
1329+ const checkAppAccess = useAtomCommand ( sourceControlEnvironment . checkAppAccess , {
1330+ reportFailure : false ,
1331+ reportDefect : false ,
1332+ } ) ;
13181333 const navigation = useNavigation ( ) ;
13191334 const environment = useEnvironmentFromParam ( props . environmentId ) ;
13201335 const canWriteSourceControl = useEnvironmentScope (
@@ -1376,6 +1391,7 @@ export function AddProjectDestinationScreen(props: {
13761391 if ( AsyncResult . isFailure ( startResult ) ) {
13771392 setError ( errorMessage ( Cause . squash ( startResult . cause ) ) ) ;
13781393 } else {
1394+ void suggestAppAccessForRemote ( checkAppAccess , environment . environmentId , remoteUrl ) ;
13791395 // Wait for the create event; the client store otherwise falls back to the project picker and loses clone controls.
13801396 const project = await waitForProject (
13811397 { environmentId : environment . environmentId , projectId } ,
0 commit comments