@trackunit/react-core-hooks 1.31.43 → 1.31.44-alpha-fbcc0881f4f.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/index.cjs.js
CHANGED
|
@@ -137,9 +137,9 @@ const useValidateAccessAsync = () => {
|
|
|
137
137
|
* plus a `loading` flag that stays true until user, subscription, and flag data
|
|
138
138
|
* are all present.
|
|
139
139
|
*
|
|
140
|
-
* `accountActions` needs no term of its own in `loading`: `
|
|
141
|
-
*
|
|
142
|
-
*
|
|
140
|
+
* `accountActions` needs no term of its own in `loading`: `CurrentUserBootstrapHost`
|
|
141
|
+
* publishes it in the same update as `permissions`, so waiting on the latter already
|
|
142
|
+
* waits for the former.
|
|
143
143
|
*/
|
|
144
144
|
const useValidateAccess = () => {
|
|
145
145
|
const { accountActions, isAuthenticated, permissions: userPermissions } = useCurrentUser();
|
|
@@ -161,8 +161,8 @@ const useValidateAccess = () => {
|
|
|
161
161
|
}
|
|
162
162
|
return false;
|
|
163
163
|
}, [isAuthenticated, userPermissions]);
|
|
164
|
-
//
|
|
165
|
-
// flag above already covers them and needs no term of its own.
|
|
164
|
+
// `CurrentUserBootstrapHost` publishes actions in the same update as `permissions`, so
|
|
165
|
+
// the `loading` flag above already covers them and needs no term of its own.
|
|
166
166
|
const hasAccountAction = react.useCallback((action) => {
|
|
167
167
|
if (isAuthenticated) {
|
|
168
168
|
return accountActions?.[action] ?? false;
|
package/index.esm.js
CHANGED
|
@@ -135,9 +135,9 @@ const useValidateAccessAsync = () => {
|
|
|
135
135
|
* plus a `loading` flag that stays true until user, subscription, and flag data
|
|
136
136
|
* are all present.
|
|
137
137
|
*
|
|
138
|
-
* `accountActions` needs no term of its own in `loading`: `
|
|
139
|
-
*
|
|
140
|
-
*
|
|
138
|
+
* `accountActions` needs no term of its own in `loading`: `CurrentUserBootstrapHost`
|
|
139
|
+
* publishes it in the same update as `permissions`, so waiting on the latter already
|
|
140
|
+
* waits for the former.
|
|
141
141
|
*/
|
|
142
142
|
const useValidateAccess = () => {
|
|
143
143
|
const { accountActions, isAuthenticated, permissions: userPermissions } = useCurrentUser();
|
|
@@ -159,8 +159,8 @@ const useValidateAccess = () => {
|
|
|
159
159
|
}
|
|
160
160
|
return false;
|
|
161
161
|
}, [isAuthenticated, userPermissions]);
|
|
162
|
-
//
|
|
163
|
-
// flag above already covers them and needs no term of its own.
|
|
162
|
+
// `CurrentUserBootstrapHost` publishes actions in the same update as `permissions`, so
|
|
163
|
+
// the `loading` flag above already covers them and needs no term of its own.
|
|
164
164
|
const hasAccountAction = useCallback((action) => {
|
|
165
165
|
if (isAuthenticated) {
|
|
166
166
|
return accountActions?.[action] ?? false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/core-hooks/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-hooks",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.44-alpha-fbcc0881f4f.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"es-toolkit": "^1.52.0",
|
|
11
|
-
"@trackunit/iris-app-runtime-core": "1.28.
|
|
12
|
-
"@trackunit/iris-app-runtime-core-api": "1.27.
|
|
13
|
-
"@trackunit/react-core-contexts-api": "1.28.
|
|
11
|
+
"@trackunit/iris-app-runtime-core": "1.28.43-alpha-fbcc0881f4f.0",
|
|
12
|
+
"@trackunit/iris-app-runtime-core-api": "1.27.43-alpha-fbcc0881f4f.0",
|
|
13
|
+
"@trackunit/react-core-contexts-api": "1.28.43-alpha-fbcc0881f4f.0",
|
|
14
14
|
"zod": "^3.25.76"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
@@ -19,9 +19,9 @@ export declare const useValidateAccessAsync: () => {
|
|
|
19
19
|
* plus a `loading` flag that stays true until user, subscription, and flag data
|
|
20
20
|
* are all present.
|
|
21
21
|
*
|
|
22
|
-
* `accountActions` needs no term of its own in `loading`: `
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* `accountActions` needs no term of its own in `loading`: `CurrentUserBootstrapHost`
|
|
23
|
+
* publishes it in the same update as `permissions`, so waiting on the latter already
|
|
24
|
+
* waits for the former.
|
|
25
25
|
*/
|
|
26
26
|
export declare const useValidateAccess: () => {
|
|
27
27
|
hasAccessTo: (requiredAccessTo: ValidateAccess) => HasAccess;
|