You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/06/11 02:41:38 UTC

(incubator-devlake) 01/01: fix: error current page when deleting the last data scope

This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch fix-data-scope-delete
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit f961e2f1bde202ae2b629d6bc33ac3b4c852749f
Author: mintsweet <0x...@gmail.com>
AuthorDate: Tue Jun 11 14:41:24 2024 +1200

    fix: error current page when deleting the last data scope
---
 config-ui/src/routes/connection/connection.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/config-ui/src/routes/connection/connection.tsx b/config-ui/src/routes/connection/connection.tsx
index d2d81e623..213061519 100644
--- a/config-ui/src/routes/connection/connection.tsx
+++ b/config-ui/src/routes/connection/connection.tsx
@@ -182,7 +182,11 @@ export const Connection = () => {
     );
 
     if (res.status === 'success') {
-      setVersion((v) => v + 1);
+      if (dataSource.length === 1) {
+        setPage(page - 1);
+      } else {
+        setVersion((v) => v + 1);
+      }
       message.success(onlyData ? 'Clear historical data successful.' : 'Delete Data Scope successful.');
       handleHideDialog();
     } else if (res.status === 'conflict') {