Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

transluscent

Manav Rathi37172c829188
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsx
index 5fb6e024df..fadf332022 100644
--- a/web/apps/auth/src/pages/_app.tsx
+++ b/web/apps/auth/src/pages/_app.tsx
@@ -29,7 +29,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
useSetupLogs();
const isI18nReady = useSetupI18n();
- const isLoadingRoute = useIsRouteChangeInProgress();
+ const isChangingRoute = useIsRouteChangeInProgress();
const { showMiniDialog, miniDialogProps } = useAttributedMiniDialog();
useEffect(() => {
@@ -65,7 +65,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<AppContext.Provider value={appContext}>
{!isI18nReady ? (
<LoadingOverlay />
- ) : isLoadingRoute ? (
+ ) : isChangingRoute ? (
<TranslucentLoadingOverlay />
) : (
<Component {...pageProps} />
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index 9128775257..1011679f71 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -1,12 +1,19 @@
import { clientPackageName, isDesktop, staticAppTitle } from "@/base/app";
import { CustomHead } from "@/base/components/Head";
-import { LoadingOverlay } from "@/base/components/loaders";
+import {
+ LoadingOverlay,
+ TranslucentLoadingOverlay,
+} from "@/base/components/loaders";
import { AttributedMiniDialog } from "@/base/components/MiniDialog";
import {
genericErrorDialogAttributes,
useAttributedMiniDialog,
} from "@/base/components/utils/dialog";
-import { useSetupI18n, useSetupLogs } from "@/base/components/utils/hooks-app";
+import {
+ useIsRouteChangeInProgress,
+ useSetupI18n,
+ useSetupLogs,
+} from "@/base/components/utils/hooks-app";
import { photosTheme } from "@/base/components/utils/theme";
import log from "@/base/log";
import { logStartupBanner } from "@/base/log-web";
@@ -49,12 +56,12 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
useSetupLogs();
const isI18nReady = useSetupI18n();
+ const isChangingRoute = useIsRouteChangeInProgress();
const router = useRouter();
const { showMiniDialog, miniDialogProps } = useAttributedMiniDialog();
const { showNotification, notificationProps } = useNotification();
const { loadingBarRef, showLoadingBar, hideLoadingBar } = useLoadingBar();
- const [loading, setLoading] = useState(false);
const [watchFolderView, setWatchFolderView] = useState(false);
useEffect(() => {
@@ -115,12 +122,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
if (needsFamilyRedirect && getData(LS_KEYS.USER)?.token)
redirectToFamilyPortal();
- router.events.on("routeChangeStart", (url: string) => {
- const newPathname = url.split("?")[0];
- if (window.location.pathname !== newPathname) {
- showLoadingBar();
- }
-
+ router.events.on("routeChangeStart", () => {
if (needsFamilyRedirect && getData(LS_KEYS.USER)?.token) {
redirectToFamilyPortal();
@@ -129,10 +131,6 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
throw "Aborting route change, redirection in process....";
}
});
-
- router.events.on("routeChangeComplete", () => {
- hideLoadingBar();
- });
}, []);
const onGenericError = useCallback((e: unknown) => {
@@ -191,6 +189,8 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
<AppContext.Provider value={appContext}>
{!isI18nReady ? (
<LoadingOverlay />
+ ) : isChangingRoute ? (
+ <TranslucentLoadingOverlay />
) : (
<Component {...pageProps} />
)}