File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
components/dashboard/src/data/organizations Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ export type SuggestedOrgRepository = PlainMessage<SuggestedRepository> & {
28
28
29
29
export function useOrgSuggestedRepos ( ) {
30
30
const organizationId = useCurrentOrg ( ) . data ?. id ;
31
- const orgSettings = useOrgSettingsQuery ( ) ;
31
+ const { data : orgSettings , isLoading : isOrgSettingsLoading } = useOrgSettingsQuery ( ) ;
32
32
33
33
const query = useQuery < SuggestedOrgRepository [ ] , Error > (
34
34
getQueryKey ( organizationId ) ,
35
35
async ( ) => {
36
- const repos = orgSettings . data ?. onboardingSettings ?. recommendedRepositories ?? [ ] ;
36
+ const repos = orgSettings ?. onboardingSettings ?. recommendedRepositories ?? [ ] ;
37
37
38
38
const suggestions : SuggestedOrgRepository [ ] = [ ] ;
39
39
for ( const configurationId of repos ) {
@@ -58,7 +58,7 @@ export function useOrgSuggestedRepos() {
58
58
return suggestions ;
59
59
} ,
60
60
{
61
- enabled : ! ! organizationId ,
61
+ enabled : ! ! organizationId && ! isOrgSettingsLoading ,
62
62
cacheTime : 1000 * 60 * 60 * 24 * 7 , // 1 week
63
63
staleTime : 1000 * 60 * 5 , // 5 minutes
64
64
} ,
You can’t perform that action at this time.
0 commit comments