@@ -32,7 +32,7 @@ import {
3232 UserIcon ,
3333} from "lowcoder-design" ;
3434import React , { useCallback , useEffect , useState , useMemo } from "react" ;
35- import { fetchAllApplications , fetchHomeData } from "redux/reduxActions/applicationActions" ;
35+ import { fetchHomeData } from "redux/reduxActions/applicationActions" ;
3636import { fetchSubscriptionsAction } from "redux/reduxActions/subscriptionActions" ;
3737import { getHomeOrg , normalAppListSelector } from "redux/selectors/applicationSelector" ;
3838import { DatasourceHome } from "../datasource" ;
@@ -125,18 +125,13 @@ export default function ApplicationHome() {
125125 } , [ org , orgHomeId ] ) ;
126126
127127 useEffect ( ( ) => {
128- if ( allAppCount !== 0 ) {
129- return ;
130- }
131- user . currentOrgId && dispatch ( fetchAllApplications ( { } ) ) ;
132- } , [ dispatch , allAppCount , user . currentOrgId ] ) ;
133-
134- useEffect ( ( ) => {
135- if ( allFoldersCount !== 0 ) {
128+ // Check if we need to fetch data (either no folders or no applications)
129+ if ( allFoldersCount !== 0 && allAppCount !== 0 ) {
136130 return ;
137131 }
132+
138133 user . currentOrgId && dispatch ( fetchFolderElements ( { } ) ) ;
139- } , [ dispatch , allFoldersCount , user . currentOrgId ] ) ;
134+ } , [ dispatch , allFoldersCount , allAppCount , user . currentOrgId ] ) ;
140135
141136 if ( fetchingUser || ! isPreloadCompleted ) {
142137 return < ProductLoading /> ;
0 commit comments