Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e782962a
authored
Jul 02, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix refresh not working properly (close #229)
parent
a26e0ebf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
web/src/components/ChannelsTable.js
+4
-4
web/src/components/LogsTable.js
+1
-1
web/src/components/TokensTable.js
+3
-3
No files found.
web/src/components/ChannelsTable.js
View file @
e782962a
...
...
@@ -60,8 +60,8 @@ const ChannelsTable = () => {
if
(
startIdx
===
0
)
{
setChannels
(
data
);
}
else
{
let
newChannels
=
channels
;
newChannels
.
push
(
...
data
);
let
newChannels
=
[...
channels
]
;
newChannels
.
splice
(
startIdx
*
ITEMS_PER_PAGE
,
data
.
length
,
...
data
);
setChannels
(
newChannels
);
}
}
else
{
...
...
@@ -82,7 +82,7 @@ const ChannelsTable = () => {
const
refresh
=
async
()
=>
{
setLoading
(
true
);
await
loadChannels
(
0
);
await
loadChannels
(
activePage
-
1
);
};
useEffect
(()
=>
{
...
...
@@ -240,7 +240,7 @@ const ChannelsTable = () => {
if
(
channels
.
length
===
0
)
return
;
setLoading
(
true
);
let
sortedChannels
=
[...
channels
];
if
(
typeof
sortedChannels
[
0
][
key
]
===
'string'
){
if
(
typeof
sortedChannels
[
0
][
key
]
===
'string'
)
{
sortedChannels
.
sort
((
a
,
b
)
=>
{
return
(
''
+
a
[
key
]).
localeCompare
(
b
[
key
]);
});
...
...
web/src/components/LogsTable.js
View file @
e782962a
...
...
@@ -108,7 +108,7 @@ const LogsTable = () => {
setLogs
(
data
);
}
else
{
let
newLogs
=
[...
logs
];
newLogs
.
push
(
...
data
);
newLogs
.
splice
(
startIdx
*
ITEMS_PER_PAGE
,
data
.
length
,
...
data
);
setLogs
(
newLogs
);
}
}
else
{
...
...
web/src/components/TokensTable.js
View file @
e782962a
...
...
@@ -45,8 +45,8 @@ const TokensTable = () => {
if
(
startIdx
===
0
)
{
setTokens
(
data
);
}
else
{
let
newTokens
=
tokens
;
newTokens
.
push
(
...
data
);
let
newTokens
=
[...
tokens
]
;
newTokens
.
splice
(
startIdx
*
ITEMS_PER_PAGE
,
data
.
length
,
...
data
);
setTokens
(
newTokens
);
}
}
else
{
...
...
@@ -67,7 +67,7 @@ const TokensTable = () => {
const
refresh
=
async
()
=>
{
setLoading
(
true
);
await
loadTokens
(
0
);
await
loadTokens
(
activePage
-
1
);
}
useEffect
(()
=>
{
...
...
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