@@ -37,7 +37,12 @@ const GitHubSetupPage: FC<GitHubSetupPageType> = ({ location }) => {
3737 new URLSearchParams ( location . search ) . get ( 'installation_id' ) || ''
3838 const githubIntegrationSetupFromFlagsmithValue : string =
3939 localStorage ?. githubIntegrationSetupFromFlagsmith
40- const [ organisation , setOrganisation ] = useState < string > ( '' )
40+ const lastOrgId = localStorage . lastEnv
41+ ? JSON . parse ( localStorage . lastEnv ) . orgId
42+ : undefined
43+ const [ organisation , setOrganisation ] = useState < string > (
44+ lastOrgId ? `${ lastOrgId } ` : '' ,
45+ )
4146 const [ project , setProject ] = useState < any > ( { } )
4247 const [ projects , setProjects ] = useState < ProjectType [ ] > ( [ ] )
4348 const [ repositoryName , setRepositoryName ] = useState < string > ( '' )
@@ -127,15 +132,16 @@ const GitHubSetupPage: FC<GitHubSetupPageType> = ({ location }) => {
127132 />
128133 < div className = 'mr-4 mb-4' >
129134 < label > Select your Flagsmith Organisation</ label >
130- < OrganisationSelect
131- onChange = { ( organisationId : string ) => {
132- setOrganisation ( `${ organisationId } ` )
133- AppActions . selectOrganisation ( organisationId )
134- AppActions . getOrganisation ( organisationId )
135- } }
136- showSettings = { false }
137- firstOrganisation
138- />
135+ < div style = { { width : '500px' } } >
136+ < OrganisationSelect
137+ value = { organisation ? parseInt ( organisation ) : undefined }
138+ onChange = { ( organisationId ) => {
139+ setOrganisation ( `${ organisationId } ` )
140+ AppActions . selectOrganisation ( organisationId )
141+ AppActions . getOrganisation ( organisationId )
142+ } }
143+ />
144+ </ div >
139145 </ div >
140146 < label >
141147 Select your Flagsmith Project and your Github Repository
0 commit comments