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> & {
2828
2929export function useOrgSuggestedRepos ( ) {
3030 const organizationId = useCurrentOrg ( ) . data ?. id ;
31- const orgSettings = useOrgSettingsQuery ( ) ;
31+ const { data : orgSettings , isLoading : isOrgSettingsLoading } = useOrgSettingsQuery ( ) ;
3232
3333 const query = useQuery < SuggestedOrgRepository [ ] , Error > (
3434 getQueryKey ( organizationId ) ,
3535 async ( ) => {
36- const repos = orgSettings . data ?. onboardingSettings ?. recommendedRepositories ?? [ ] ;
36+ const repos = orgSettings ?. onboardingSettings ?. recommendedRepositories ?? [ ] ;
3737
3838 const suggestions : SuggestedOrgRepository [ ] = [ ] ;
3939 for ( const configurationId of repos ) {
@@ -58,7 +58,7 @@ export function useOrgSuggestedRepos() {
5858 return suggestions ;
5959 } ,
6060 {
61- enabled : ! ! organizationId ,
61+ enabled : ! ! organizationId && ! isOrgSettingsLoading ,
6262 cacheTime : 1000 * 60 * 60 * 24 * 7 , // 1 week
6363 staleTime : 1000 * 60 * 5 , // 5 minutes
6464 } ,
You can’t perform that action at this time.
0 commit comments