🐛 fix return to first page after refresh

This commit is contained in:
Martial BE
2023-12-29 17:02:09 +08:00
parent 9c0a49b97a
commit fc284cc1f0
3 changed files with 5 additions and 11 deletions

View File

@@ -116,7 +116,7 @@ export default function ChannelPage() {
if (success) {
showSuccess('操作成功完成!');
if (action === 'delete') {
await loadChannels(0);
await handleRefresh();
}
} else {
showError(message);
@@ -127,9 +127,7 @@ export default function ChannelPage() {
// 处理刷新
const handleRefresh = async () => {
await loadChannels(0);
setActivePage(0);
setSearchKeyword('');
await loadChannels(activePage);
};
// 处理测试所有启用渠道

View File

@@ -108,7 +108,7 @@ export default function Token() {
if (success) {
showSuccess('操作成功完成!');
if (action === 'delete') {
await loadTokens(0);
await handleRefresh();
}
} else {
showError(message);
@@ -119,9 +119,7 @@ export default function Token() {
// 处理刷新
const handleRefresh = async () => {
await loadTokens(0);
setActivePage(0);
setSearchKeyword('');
await loadTokens(activePage);
};
const handleOpenModal = (tokenId) => {

View File

@@ -109,9 +109,7 @@ export default function Users() {
// 处理刷新
const handleRefresh = async () => {
await loadUsers(0);
setActivePage(0);
setSearchKeyword('');
await loadUsers(activePage);
};
const handleOpenModal = (userId) => {