Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 049d372

Browse files
committed
make currentOrg selector
1 parent 1b63471 commit 049d372

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎client/packages/lowcoder/src/pages/common/profileDropdown.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Input } from "antd";
44
import { Org, OrgRoleInfo } from "constants/orgConstants";
55
import { ORGANIZATION_SETTING } from "constants/routesURL";
66
import { User } from "constants/userConstants";
7-
import { getWorkspaces } from "redux/selectors/orgSelectors";
7+
import { getWorkspaces, getCurrentOrg } from "redux/selectors/orgSelectors";
88
import {
99
AddIcon,
1010
CheckoutIcon,
@@ -242,11 +242,7 @@ export default function ProfileDropdown(props: DropDownProps) {
242242
const { avatarUrl, username, orgs, currentOrgId } = props.user;
243243
const currentOrgRoleId = props.user.orgRoleMap.get(currentOrgId);
244244
const workspaces = useSelector(getWorkspaces);
245-
console.log("workspaces", workspaces);
246-
const currentOrg = useMemo(
247-
() => props.user.orgs.find((o) => o.id === currentOrgId),
248-
[props.user, currentOrgId]
249-
);
245+
const currentOrg = useSelector(getCurrentOrg);
250246
const settingModalVisible = useSelector(isProfileSettingModalVisible);
251247
const sysConfig = useSelector(selectSystemConfig);
252248
const dispatch = useDispatch();

0 commit comments

Comments
 (0)