File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
client/packages/lowcoder/src/redux/selectors Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11import { Org } from "@lowcoder-ee/constants/orgConstants" ;
22import { getUser } from "./usersSelectors" ;
33import { AppState } from "redux/reducers" ;
4+ import { getHomeOrg } from "./applicationSelector" ;
45
56export const getOrgUsers = ( state : AppState ) => {
67 return state . ui . org . orgUsers ;
@@ -33,8 +34,14 @@ export const getOrgLastMonthApiUsage = (state: AppState) => {
3334// Add to usersSelectors.ts
3435export const getWorkspaces = ( state : AppState ) => state . ui . users . workspaces ;
3536
36- export const getCurrentOrg = ( state : AppState ) : Org | undefined => {
37- const user = getUser ( state ) ;
38- const workspaces = getWorkspaces ( state ) ;
39- return workspaces . items . find ( org => org . id === user . currentOrgId ) ;
37+ export const getCurrentOrg = ( state : AppState ) : Pick < Org , 'id' | 'name' > | undefined => {
38+ const homeOrg = getHomeOrg ( state ) ;
39+ if ( ! homeOrg ) {
40+ return undefined ;
41+ }
42+
43+ return {
44+ id : homeOrg . id ,
45+ name : homeOrg . name ,
46+ } ;
4047} ;
You can’t perform that action at this time.
0 commit comments