Skip to content

Commit 7d162ac

Browse files
committed
feat: show loading indicator on token request
1 parent 8fb6d9b commit 7d162ac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pages/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h1>TickTick OAuth</h1>
5454
<p>
5555
Copy the access token below and paste it into the Logseq plugin settings.
5656
</p>
57-
<p>Your TickTick access token: <code><span id="td_access_token"></span></code></p>
57+
<p>Your TickTick access token: <code><span id="td_access_token" aria-busy="true"></span></code></p>
5858
<br>
5959
<p>
6060
<a href="index.html">Go back</a>
@@ -81,6 +81,9 @@ <h1>TickTick OAuth</h1>
8181

8282
const params = new URLSearchParams(window.location.search);
8383
if (params.has('code')) {
84+
document.querySelector('#step-1').style.display = 'none';
85+
document.querySelector('#step-2').style.display = 'block';
86+
8487
fetch("https://ywcmjymjeeppwgdfqncs.functions.supabase.co/ticktick-auth",
8588
{
8689
method: "POST",
@@ -97,9 +100,8 @@ <h1>TickTick OAuth</h1>
97100
).then(res => res.ok ? res.json() : Promise.reject(res))
98101
.then(data => {
99102
console.log(data);
103+
document.querySelector('#td_access_token').setAttribute('aria-busy', 'false');
100104
document.querySelector('#td_access_token').innerText = data.access_token;
101-
document.querySelector('#step-1').style.display = 'none';
102-
document.querySelector('#step-2').style.display = 'block';
103105
})
104106
.catch(err => {
105107
console.error(err);

0 commit comments

Comments
 (0)