@@ -57,6 +57,7 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
57
57
const noReposAvailable = ! ! ( reposInAccounts ?. length === 0 || areGitHubWebhooksUnauthorized ) ;
58
58
// TODO: check type instead of host?
59
59
const isGitHub = selectedProvider ?. host === "github.com" ;
60
+ const isBitbucketServer = selectedProvider ?. authProviderType !== "BitbucketServer" ;
60
61
61
62
const accounts = useMemo ( ( ) => {
62
63
const accounts = new Map < string , { avatarUrl : string } > ( ) ;
@@ -125,6 +126,11 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
125
126
126
127
// Adjusts selectedAccount when repos change if we don't have a selected account
127
128
useEffect ( ( ) => {
129
+ // TODO: find a better solution here
130
+ if ( isBitbucketServer ) {
131
+ return ;
132
+ }
133
+
128
134
if ( reposInAccounts ?. length === 0 ) {
129
135
setSelectedAccountAndClearSearch ( undefined ) ;
130
136
} else if ( ! selectedAccount ) {
@@ -138,11 +144,7 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
138
144
setSelectedAccountAndClearSearch ( first ?. account ) ;
139
145
}
140
146
}
141
- } , [ reposInAccounts , selectedAccount , setSelectedAccountAndClearSearch ] ) ;
142
-
143
- if ( isLoading ) {
144
- return < ReposLoading /> ;
145
- }
147
+ } , [ isBitbucketServer , reposInAccounts , selectedAccount , setSelectedAccountAndClearSearch ] ) ;
146
148
147
149
return (
148
150
< >
@@ -152,7 +154,7 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
152
154
</ p >
153
155
< div className = { `mt-2 flex-col ${ noReposAvailable && isGitHub ? "w-96" : "" } ` } >
154
156
< div className = "px-8 flex flex-col space-y-2" data-analytics = '{"label":"Identity"}' >
155
- { selectedProvider ?. authProviderType !== "BitbucketServer" && (
157
+ { ! isBitbucketServer && (
156
158
< NewProjectAccountSelector
157
159
accounts = { accounts }
158
160
selectedAccount = { selectedAccount }
@@ -165,12 +167,16 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
165
167
< NewProjectSearchInput searchFilter = { repoSearchFilter } onSearchFilterChange = { setRepoSearchFilter } />
166
168
</ div >
167
169
< div className = "p-6 flex-col" >
168
- < NewProjectRepoList
169
- isCreating = { createProject . isLoading }
170
- filteredRepos = { filteredRepos }
171
- noReposAvailable = { noReposAvailable }
172
- onRepoSelected = { handleRepoSelected }
173
- />
170
+ { isLoading ? (
171
+ < ReposLoading />
172
+ ) : (
173
+ < NewProjectRepoList
174
+ isCreating = { createProject . isLoading }
175
+ filteredRepos = { filteredRepos }
176
+ noReposAvailable = { noReposAvailable }
177
+ onRepoSelected = { handleRepoSelected }
178
+ />
179
+ ) }
174
180
{ ! isLoading && noReposAvailable && isGitHub && (
175
181
< NewProjectAuthRequired
176
182
selectedProviderHost = { selectedProvider ?. host }
@@ -180,7 +186,7 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
180
186
) }
181
187
</ div >
182
188
</ div >
183
- { reposInAccounts && reposInAccounts . length > 0 && isGitHub && isGitHubAppEnabled && (
189
+ { ! isLoading && reposInAccounts && reposInAccounts . length > 0 && isGitHub && isGitHubAppEnabled && (
184
190
< div >
185
191
< div className = "text-gray-500 text-center w-96 mx-8" >
186
192
Repository not found?{ " " }
@@ -193,7 +199,7 @@ export const NewProjectRepoSelection: FC<Props> = ({ selectedProvider, onProject
193
199
</ div >
194
200
</ div >
195
201
) }
196
- { ( filteredRepos ?. length ?? 0 ) === 0 && repoSearchFilter . length > 0 && (
202
+ { ! isLoading && ( filteredRepos ?. length ?? 0 ) === 0 && repoSearchFilter . length > 0 && (
197
203
< NewProjectCreateFromURL
198
204
repoSearchFilter = { repoSearchFilter }
199
205
isCreating = { createProject . isLoading }
0 commit comments