@overmap-ai/core 1.0.26 → 1.0.27

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.
@@ -4865,16 +4865,14 @@ var __publicField = (obj, key, value) => {
4865
4865
  const firstOrg = organizationsData[0];
4866
4866
  const currProjObj = projects.find((project) => project.id === currentProjectId);
4867
4867
  const isOrgProject = !!(currProjObj == null ? void 0 : currProjObj.owner_organization);
4868
- let currentOrgId = -1;
4869
- if (isOrgProject && currProjObj.owner_organization) {
4868
+ const userIsInProjectOrg = isOrgProject && organizationsData.some((organization) => organization.id === currProjObj.owner_organization);
4869
+ let currentOrgId = null;
4870
+ if (userIsInProjectOrg) {
4870
4871
  currentOrgId = currProjObj.owner_organization;
4871
4872
  } else if (firstOrg) {
4872
- console.warn(
4873
- "No active organization; using the first available one. TODO: No active organization in personal projects."
4874
- );
4875
4873
  currentOrgId = firstOrg.id;
4876
4874
  }
4877
- if (currentOrgId !== -1) {
4875
+ if (currentOrgId) {
4878
4876
  store.dispatch(setActiveOrganizationId(currentOrgId));
4879
4877
  const orgUsersResultPromise = this.fetchOrganizationUsers(currentOrgId);
4880
4878
  const organizationAccessRefreshPromise = this.client.organizationAccess.refreshStore();