Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.

Commit 00a7ae1

Browse files
committed
fix: improve preview behaviour
1 parent 0712d43 commit 00a7ae1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/demo/TokenForm.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,29 @@ export const TokenForm = ({
4444
}
4545
})
4646

47+
const parsedToken = parseToken(token)
48+
4749
return (
4850
<form onSubmit={e => e.preventDefault()}>
4951
<fieldset>
5052
<legend>Token</legend>
53+
<p>Enter a token here and click apply.</p>
5154
<textarea
5255
style={{ width: '100%' }}
5356
placeholder={'Paste your token here'}
5457
value={token}
5558
onChange={({ target: { value } }) => memoToken(value)}
5659
></textarea>
57-
{token.length > 0 && <Token {...parseToken(token)} />}
60+
<button
61+
type="button"
62+
onClick={() => {
63+
document.location.reload()
64+
}}
65+
disabled={parsedToken?.header?.typ !== 'JWT' ?? true}
66+
>
67+
apply
68+
</button>
69+
{token.length > 0 && <Token {...parsedToken} />}
5870
</fieldset>
5971
</form>
6072
)

web/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1>Distribute Aid: Chat</h1>
7070

7171
const loadJsAsync = deps =>
7272
loadjs(deps, {
73-
async: true,
73+
async: false,
7474
returnPromise: true
7575
});
7676

0 commit comments

Comments
 (0)