Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
2888bbbd
Commit
2888bbbd
authored
Aug 15, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delay helper
parent
b2264707
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
delay.ts
lib/delay.ts
+3
-0
private-tags.tsx
pages/[network_type]/[network_sub_type]/private-tags.tsx
+3
-3
ApiKeys.tsx
ui/pages/ApiKeys.tsx
+2
-2
No files found.
lib/delay.ts
0 → 100644
View file @
2888bbbd
export
default
function
delay
(
time
:
number
)
{
return
new
Promise
((
resolve
)
=>
window
.
setTimeout
(
resolve
,
time
));
}
pages/[network_type]/[network_sub_type]/private-tags.tsx
View file @
2888bbbd
...
...
@@ -3,10 +3,10 @@ import type { NextPage } from 'next';
import
Head
from
'
next/head
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
delay
from
'
lib/delay
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
];
const
artificialDelay
=
new
Promise
((
resolve
)
=>
window
.
setTimeout
(
resolve
,
5000
));
const
PrivateTagsPage
:
NextPage
=
()
=>
{
const
[
activeTab
,
setActiveTab
]
=
useState
(
TABS
[
0
]);
...
...
@@ -22,7 +22,7 @@ const PrivateTagsPage: NextPage = () => {
useQuery
([
'
address
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
fetch
(
'
/api/account/private-tags/address
'
),
artificialDelay
,
delay
(
5000
)
,
]);
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
...
...
@@ -33,7 +33,7 @@ const PrivateTagsPage: NextPage = () => {
useQuery
([
'
transaction
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
fetch
(
'
/api/account/private-tags/transaction
'
),
artificialDelay
,
delay
(
5000
)
,
]);
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
...
...
ui/pages/ApiKeys.tsx
View file @
2888bbbd
...
...
@@ -4,6 +4,7 @@ import React, { useCallback, useState } from 'react';
import
type
{
ApiKey
,
ApiKeys
}
from
'
types/api/account
'
;
import
delay
from
'
lib/delay
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
ApiKeyModal
from
'
ui/apiKey/ApiKeyModal/ApiKeyModal
'
;
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
...
...
@@ -13,7 +14,6 @@ import Page from 'ui/shared/Page/Page';
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
const
DATA_LIMIT
=
3
;
const
artificialDelay
=
new
Promise
((
resolve
)
=>
window
.
setTimeout
(
resolve
,
5000
));
const
ApiKeysPage
:
React
.
FC
=
()
=>
{
const
apiKeyModalProps
=
useDisclosure
();
...
...
@@ -25,7 +25,7 @@ const ApiKeysPage: React.FC = () => {
const
{
data
,
isLoading
,
isError
}
=
useQuery
<
unknown
,
unknown
,
ApiKeys
>
([
'
api-keys
'
],
async
()
=>
{
const
[
response
]
=
await
Promise
.
all
([
fetch
(
'
/api/account/api-keys
'
),
artificialDelay
,
delay
(
5000
)
,
]);
if
(
!
response
.
ok
)
{
throw
new
Error
(
'
Network response was not ok
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment