@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.
package/dist/overmap-core.js
CHANGED
|
@@ -4877,16 +4877,14 @@ class MainService extends BaseApiService {
|
|
|
4877
4877
|
const firstOrg = organizationsData[0];
|
|
4878
4878
|
const currProjObj = projects.find((project) => project.id === currentProjectId);
|
|
4879
4879
|
const isOrgProject = !!(currProjObj == null ? void 0 : currProjObj.owner_organization);
|
|
4880
|
-
|
|
4881
|
-
|
|
4880
|
+
const userIsInProjectOrg = isOrgProject && organizationsData.some((organization) => organization.id === currProjObj.owner_organization);
|
|
4881
|
+
let currentOrgId = null;
|
|
4882
|
+
if (userIsInProjectOrg) {
|
|
4882
4883
|
currentOrgId = currProjObj.owner_organization;
|
|
4883
4884
|
} else if (firstOrg) {
|
|
4884
|
-
console.warn(
|
|
4885
|
-
"No active organization; using the first available one. TODO: No active organization in personal projects."
|
|
4886
|
-
);
|
|
4887
4885
|
currentOrgId = firstOrg.id;
|
|
4888
4886
|
}
|
|
4889
|
-
if (currentOrgId
|
|
4887
|
+
if (currentOrgId) {
|
|
4890
4888
|
store.dispatch(setActiveOrganizationId(currentOrgId));
|
|
4891
4889
|
const orgUsersResultPromise = this.fetchOrganizationUsers(currentOrgId);
|
|
4892
4890
|
const organizationAccessRefreshPromise = this.client.organizationAccess.refreshStore();
|