@overmap-ai/core 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4874,12 +4874,15 @@ class MainService extends BaseApiService {
4874
4874
  store.dispatch(setCurrentUser(data.user));
4875
4875
  const organizationsData = data.organizations;
4876
4876
  store.dispatch(setOrganizations(organizationsData));
4877
+ const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
4877
4878
  const firstOrg = organizationsData[0];
4878
4879
  const currProjObj = projects.find((project) => project.id === currentProjectId);
4879
4880
  const isOrgProject = !!(currProjObj == null ? void 0 : currProjObj.owner_organization);
4880
4881
  const userIsInProjectOrg = isOrgProject && organizationsData.some((organization) => organization.id === currProjObj.owner_organization);
4881
4882
  let currentOrgId = null;
4882
- if (userIsInProjectOrg) {
4883
+ if (activeOrganizationId) {
4884
+ currentOrgId = activeOrganizationId;
4885
+ } else if (userIsInProjectOrg) {
4883
4886
  currentOrgId = currProjObj.owner_organization;
4884
4887
  } else if (firstOrg) {
4885
4888
  currentOrgId = firstOrg.id;