Skip to content

Commit 46a1477

Browse files
committed
remove applications/list endpoint from home
1 parent 524bc75 commit 46a1477

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
UserIcon,
3333
} from "lowcoder-design";
3434
import React, { useCallback, useEffect, useState, useMemo } from "react";
35-
import { fetchAllApplications, fetchHomeData } from "redux/reduxActions/applicationActions";
35+
import { fetchHomeData } from "redux/reduxActions/applicationActions";
3636
import { fetchSubscriptionsAction } from "redux/reduxActions/subscriptionActions";
3737
import { getHomeOrg, normalAppListSelector } from "redux/selectors/applicationSelector";
3838
import { 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 />;

client/packages/lowcoder/src/redux/sagas/folderSagas.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,19 @@ export function* fetchFolderElementsSaga(action: ReduxAction<FetchFolderElements
118118
type: ReduxActionTypes.FETCH_ALL_FOLDERS_SUCCESS,
119119
payload: response.data.data.filter((m) => m.folder),
120120
});
121+
122+
// filter out applications with NORMAL status
123+
124+
const applications = response.data.data.filter((item): item is ApplicationMeta =>
125+
!item.folder && item.applicationStatus === "NORMAL"
126+
);
127+
128+
yield put({
129+
type: ReduxActionTypes.FETCH_ALL_APPLICATIONS_SUCCESS,
130+
payload: applications,
131+
});
121132
}
133+
122134
yield put({
123135
type: ReduxActionTypes.FETCH_FOLDER_ELEMENTS_SUCCESS,
124136
payload: { parentFolderId: action.payload.folderId, elements: response.data.data },

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy