You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2023/03/17 10:58:51 UTC
[inlong] branch master updated: [INLONG-7630][Dashboard] The page flickers when the route is switched (#7631)
This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new fa5756fa6 [INLONG-7630][Dashboard] The page flickers when the route is switched (#7631)
fa5756fa6 is described below
commit fa5756fa698633507048da825b33d600a8ec4066
Author: Daniel <le...@apache.org>
AuthorDate: Fri Mar 17 18:58:45 2023 +0800
[INLONG-7630][Dashboard] The page flickers when the route is switched (#7631)
---
inlong-dashboard/src/App.tsx | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/inlong-dashboard/src/App.tsx b/inlong-dashboard/src/App.tsx
index 95cfc5840..9c3927194 100644
--- a/inlong-dashboard/src/App.tsx
+++ b/inlong-dashboard/src/App.tsx
@@ -97,7 +97,7 @@ const App = () => {
}, [history, location, setCurrentMenu]);
return (
- <Suspense fallback={<AppLoading />}>
+ <>
<Switch>
{useLogin && (
<Route
@@ -105,25 +105,32 @@ const App = () => {
path="/login"
render={() => {
const LazyLogin = lazy(() => import('@/pages/Login'));
- return <LazyLogin />;
+ return (
+ <Suspense fallback={<AppLoading />}>
+ <LazyLogin />
+ </Suspense>
+ );
}}
/>
)}
+
<AppLayout>
- <Switch>
- {Object.keys(redirectRoutes).map(path => (
- <Route
- exact
- key={path}
- path={path}
- render={() => <Redirect to={redirectRoutes[path]} />}
- />
- ))}
- {renderRoutes(routes)}
- </Switch>
+ <Suspense fallback={<AppLoading />}>
+ <Switch>
+ {Object.keys(redirectRoutes).map(path => (
+ <Route
+ exact
+ key={path}
+ path={path}
+ render={() => <Redirect to={redirectRoutes[path]} />}
+ />
+ ))}
+ {renderRoutes(routes)}
+ </Switch>
+ </Suspense>
</AppLayout>
</Switch>
- </Suspense>
+ </>
);
};