tangled
alpha
login
or
join now
pds.ls
/
pdsls
398
fork
atom
atmosphere explorer
pds.ls
tool
typescript
atproto
398
fork
atom
overview
issues
1
pulls
pipelines
fix permission prompt unmount
handle.invalid
4 days ago
0e47a105
bc785b74
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+11
-3
1 changed file
expand all
collapse all
unified
split
src
components
permission-prompt.tsx
+11
-3
src/components/permission-prompt.tsx
···
1
1
-
import { createSignal } from "solid-js";
1
1
+
import { createEffect, createSignal } from "solid-js";
2
2
import { GRANULAR_SCOPES } from "../auth/scope-utils";
3
3
import { agent, setOpenManager, setPendingPermissionEdit } from "../auth/state";
4
4
import { Button } from "./button";
···
13
13
};
14
14
15
15
export const PermissionPromptContainer = () => {
16
16
+
const [displayedScope, setDisplayedScope] = createSignal<ScopeId | null>(null);
17
17
+
18
18
+
createEffect(() => {
19
19
+
const scope = requestedScope();
20
20
+
if (scope !== null) setDisplayedScope(scope);
21
21
+
});
22
22
+
16
23
const scopeLabel = () => {
17
17
-
const scope = GRANULAR_SCOPES.find((s) => s.id === requestedScope());
18
18
-
return scope?.label.toLowerCase() || requestedScope();
24
24
+
const scope = GRANULAR_SCOPES.find((s) => s.id === displayedScope());
25
25
+
return scope?.label.toLowerCase() || displayedScope();
19
26
};
20
27
21
28
const handleEditPermissions = () => {
···
30
37
<Modal
31
38
open={requestedScope() !== null}
32
39
onClose={() => setRequestedScope(null)}
40
40
+
onClosed={() => setDisplayedScope(null)}
33
41
contentClass="dark:bg-dark-300 dark:shadow-dark-700 pointer-events-auto w-[calc(100%-2rem)] max-w-md rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 p-4 shadow-md dark:border-neutral-700"
34
42
>
35
43
<h2 class="mb-2 font-semibold">Permission required</h2>