@elinpf/dsh-ops-access-ui 0.3.0 → 0.4.1
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/lib/client.js +1 -6
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -39,7 +39,6 @@ __export(client_exports, {
|
|
|
39
39
|
inject: () => inject,
|
|
40
40
|
liveGrantFor: () => liveGrantFor,
|
|
41
41
|
name: () => name,
|
|
42
|
-
pendingRequestCount: () => pendingRequestCount,
|
|
43
42
|
postPanelDecide: () => postPanelDecide,
|
|
44
43
|
postPanelDeny: () => postPanelDeny,
|
|
45
44
|
postPanelExtend: () => postPanelExtend,
|
|
@@ -202,10 +201,6 @@ function postPanelDecide(id, approved, ttlMinutes) {
|
|
|
202
201
|
body: JSON.stringify(approved ? { id, approved, ttlMinutes } : { id, approved })
|
|
203
202
|
}, "postPanelDecide");
|
|
204
203
|
}
|
|
205
|
-
function pendingRequestCount(requests) {
|
|
206
|
-
if (!Array.isArray(requests)) return 0;
|
|
207
|
-
return requests.length;
|
|
208
|
-
}
|
|
209
204
|
function AccessBadge(props) {
|
|
210
205
|
const sid = props.sessionId;
|
|
211
206
|
const [count, setCount] = (0, import_react.useState)(0);
|
|
@@ -214,7 +209,7 @@ function AccessBadge(props) {
|
|
|
214
209
|
let alive = true;
|
|
215
210
|
const poll = async () => {
|
|
216
211
|
const data = await fetchPanelRequests(sid);
|
|
217
|
-
if (alive && data !== null) setCount(
|
|
212
|
+
if (alive && data !== null && Array.isArray(data.requests)) setCount(data.requests.length);
|
|
218
213
|
};
|
|
219
214
|
void poll();
|
|
220
215
|
const timer = setInterval(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elinpf/dsh-ops-access-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Browser half carrier for @-mentioning ops-access profiles: the host row exists only for client-bundle discovery; candidates come from GET /ops-access/list served by @elinpf/dsh-ops-access, and mention expansion (agent/pre-step) lives there too.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|