@openmrs/esm-api 6.3.1-pre.3105 → 6.3.1-pre.3119
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/.turbo/turbo-build.log
CHANGED
package/dist/current-user.js
CHANGED
|
@@ -126,7 +126,9 @@ export function getLoggedInUser() {
|
|
|
126
126
|
if (state.loaded && state.session.user) {
|
|
127
127
|
user = state.session.user;
|
|
128
128
|
res(state.session.user);
|
|
129
|
-
|
|
129
|
+
if (unsubscribe) {
|
|
130
|
+
unsubscribe();
|
|
131
|
+
}
|
|
130
132
|
}
|
|
131
133
|
};
|
|
132
134
|
handler(sessionStore.getState());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-api",
|
|
3
|
-
"version": "6.3.1-pre.
|
|
3
|
+
"version": "6.3.1-pre.3119",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The javascript module for interacting with the OpenMRS API",
|
|
6
6
|
"type": "module",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@openmrs/esm-navigation": "6.x"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@openmrs/esm-config": "6.3.1-pre.
|
|
65
|
-
"@openmrs/esm-error-handling": "6.3.1-pre.
|
|
66
|
-
"@openmrs/esm-globals": "6.3.1-pre.
|
|
67
|
-
"@openmrs/esm-navigation": "6.3.1-pre.
|
|
64
|
+
"@openmrs/esm-config": "6.3.1-pre.3119",
|
|
65
|
+
"@openmrs/esm-error-handling": "6.3.1-pre.3119",
|
|
66
|
+
"@openmrs/esm-globals": "6.3.1-pre.3119",
|
|
67
|
+
"@openmrs/esm-navigation": "6.3.1-pre.3119",
|
|
68
68
|
"@swc/cli": "^0.7.7",
|
|
69
69
|
"@swc/core": "^1.11.29",
|
|
70
70
|
"concurrently": "^9.1.2",
|
package/src/current-user.ts
CHANGED
|
@@ -199,14 +199,17 @@ export function userHasAccess(
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
export function getLoggedInUser() {
|
|
202
|
-
let user;
|
|
203
|
-
let unsubscribe;
|
|
202
|
+
let user: LoggedInUser;
|
|
203
|
+
let unsubscribe: () => void;
|
|
204
204
|
return new Promise<LoggedInUser>((res) => {
|
|
205
205
|
const handler = (state: SessionStore) => {
|
|
206
206
|
if (state.loaded && state.session.user) {
|
|
207
207
|
user = state.session.user;
|
|
208
208
|
res(state.session.user);
|
|
209
|
-
|
|
209
|
+
|
|
210
|
+
if (unsubscribe) {
|
|
211
|
+
unsubscribe();
|
|
212
|
+
}
|
|
210
213
|
}
|
|
211
214
|
};
|
|
212
215
|
handler(sessionStore.getState());
|