@@ -32,7 +32,7 @@ import {
32
32
UserIcon ,
33
33
} from "lowcoder-design" ;
34
34
import React , { useCallback , useEffect , useState , useMemo } from "react" ;
35
- import { fetchAllApplications , fetchHomeData } from "redux/reduxActions/applicationActions" ;
35
+ import { fetchHomeData } from "redux/reduxActions/applicationActions" ;
36
36
import { fetchSubscriptionsAction } from "redux/reduxActions/subscriptionActions" ;
37
37
import { getHomeOrg , normalAppListSelector } from "redux/selectors/applicationSelector" ;
38
38
import { DatasourceHome } from "../datasource" ;
@@ -125,18 +125,13 @@ export default function ApplicationHome() {
125
125
} , [ org , orgHomeId ] ) ;
126
126
127
127
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 ) {
136
130
return ;
137
131
}
132
+
138
133
user . currentOrgId && dispatch ( fetchFolderElements ( { } ) ) ;
139
- } , [ dispatch , allFoldersCount , user . currentOrgId ] ) ;
134
+ } , [ dispatch , allFoldersCount , allAppCount , user . currentOrgId ] ) ;
140
135
141
136
if ( fetchingUser || ! isPreloadCompleted ) {
142
137
return < ProductLoading /> ;
0 commit comments