@overmap-ai/core 1.0.17 → 1.0.18-fix-misc-issues.0
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
|
@@ -2339,8 +2339,7 @@ const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
|
2339
2339
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
2340
2340
|
const outboxReducer = outboxSlice.reducer;
|
|
2341
2341
|
const initialState$8 = {
|
|
2342
|
-
projectAccesses: {}
|
|
2343
|
-
activeProjectAccessId: null
|
|
2342
|
+
projectAccesses: {}
|
|
2344
2343
|
};
|
|
2345
2344
|
const projectAccessSlice = createSlice({
|
|
2346
2345
|
name: "projectAccess",
|
|
@@ -2383,19 +2382,10 @@ const projectAccessSlice = createSlice({
|
|
|
2383
2382
|
delete state.projectAccesses[projectAccess.offline_id];
|
|
2384
2383
|
}
|
|
2385
2384
|
}
|
|
2386
|
-
},
|
|
2387
|
-
setActiveProjectAccessId: (state, action) => {
|
|
2388
|
-
state.activeProjectAccessId = action.payload;
|
|
2389
2385
|
}
|
|
2390
2386
|
}
|
|
2391
2387
|
});
|
|
2392
|
-
const {
|
|
2393
|
-
setProjectAccesses,
|
|
2394
|
-
updateProjectAccess,
|
|
2395
|
-
removeProjectAccess,
|
|
2396
|
-
removeProjectAccessesOfProject,
|
|
2397
|
-
setActiveProjectAccessId
|
|
2398
|
-
} = projectAccessSlice.actions;
|
|
2388
|
+
const { setProjectAccesses, updateProjectAccess, removeProjectAccess, removeProjectAccessesOfProject } = projectAccessSlice.actions;
|
|
2399
2389
|
const selectProjectAccesses = (state) => {
|
|
2400
2390
|
return state.projectAccessReducer.projectAccesses;
|
|
2401
2391
|
};
|
|
@@ -2403,11 +2393,11 @@ const selectProjectAccess = (projectAccessId) => (state) => {
|
|
|
2403
2393
|
return state.projectAccessReducer.projectAccesses[projectAccessId];
|
|
2404
2394
|
};
|
|
2405
2395
|
const selectActiveProjectAccess = (state) => {
|
|
2406
|
-
const
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2396
|
+
const currentUser = state.userReducer.currentUser;
|
|
2397
|
+
const activeProjectId = state.projectReducer.activeProjectId;
|
|
2398
|
+
return Object.values(state.projectAccessReducer.projectAccesses).find((projectAccess) => {
|
|
2399
|
+
return projectAccess.user === currentUser.id && projectAccess.project === activeProjectId;
|
|
2400
|
+
}) ?? null;
|
|
2411
2401
|
};
|
|
2412
2402
|
const selectProjectAccessForUser = (user) => (state) => {
|
|
2413
2403
|
return Object.values(state.projectAccessReducer.projectAccesses).find(
|
|
@@ -3828,7 +3818,7 @@ class AuthService extends BaseApiService {
|
|
|
3828
3818
|
return [responsePromise.then(parseTokens), uuid];
|
|
3829
3819
|
} catch (e) {
|
|
3830
3820
|
if (logoutOnFailure) {
|
|
3831
|
-
this.logout();
|
|
3821
|
+
void this.logout().then();
|
|
3832
3822
|
}
|
|
3833
3823
|
throw e;
|
|
3834
3824
|
}
|
|
@@ -3903,16 +3893,16 @@ class AuthService extends BaseApiService {
|
|
|
3903
3893
|
/**
|
|
3904
3894
|
* Logs the user out
|
|
3905
3895
|
*/
|
|
3906
|
-
logout() {
|
|
3896
|
+
async logout() {
|
|
3907
3897
|
const { store } = this.client;
|
|
3908
3898
|
store.dispatch(setLoggedIn(false));
|
|
3909
3899
|
store.dispatch(clearTokens());
|
|
3910
3900
|
store.dispatch(setActiveProjectId(null));
|
|
3911
|
-
store.dispatch(setActiveProjectAccessId(null));
|
|
3912
3901
|
store.dispatch(setActiveOrganizationAccessId(null));
|
|
3913
3902
|
store.dispatch(setActiveWorkspaceId(null));
|
|
3914
3903
|
store.dispatch({ type: RESET_STATE });
|
|
3915
3904
|
store.dispatch({ type: resetStore });
|
|
3905
|
+
await localforage.clear();
|
|
3916
3906
|
window.location.reload();
|
|
3917
3907
|
}
|
|
3918
3908
|
/**
|
|
@@ -3930,7 +3920,7 @@ class AuthService extends BaseApiService {
|
|
|
3930
3920
|
store.dispatch(setTokens({ accessToken, refreshToken }));
|
|
3931
3921
|
} catch (e) {
|
|
3932
3922
|
console.error("Could not renew tokens; logging out.");
|
|
3933
|
-
this.logout();
|
|
3923
|
+
await this.logout();
|
|
3934
3924
|
throw e;
|
|
3935
3925
|
}
|
|
3936
3926
|
}
|
|
@@ -4870,7 +4860,6 @@ class ProjectAccessService extends BaseApiService {
|
|
|
4870
4860
|
throw new Error("Current user does not have a project access instance");
|
|
4871
4861
|
}
|
|
4872
4862
|
store.dispatch(setProjectAccesses(result));
|
|
4873
|
-
store.dispatch(setActiveProjectAccessId(activeProjectAccess.offline_id));
|
|
4874
4863
|
}
|
|
4875
4864
|
}
|
|
4876
4865
|
class ProjectFileService extends BaseApiService {
|
|
@@ -6063,7 +6052,6 @@ export {
|
|
|
6063
6052
|
setActiveIssueId,
|
|
6064
6053
|
setActiveOrganizationAccessId,
|
|
6065
6054
|
setActiveOrganizationId,
|
|
6066
|
-
setActiveProjectAccessId,
|
|
6067
6055
|
setActiveProjectFileId,
|
|
6068
6056
|
setActiveProjectId,
|
|
6069
6057
|
setActiveWorkspaceId,
|