Skip to content

armgit / ente

Public Imported from GitHub
0

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

Log in other apps too

Manav Rathi5eda8fd46419
diff --git a/web/apps/accounts/src/pages/_app.tsx b/web/apps/accounts/src/pages/_app.tsx
index 2aed14e480..40a4a14588 100644
--- a/web/apps/accounts/src/pages/_app.tsx
+++ b/web/apps/accounts/src/pages/_app.tsx
@@ -1,5 +1,6 @@
import { CustomHead } from "@/next/components/Head";
import { setupI18n } from "@/next/i18n";
+import { logUnhandledErrorsAndRejections } from "@/next/log-web";
import { APPS, APP_TITLES } from "@ente/shared/apps/constants";
import { Overlay } from "@ente/shared/components/Container";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
@@ -54,6 +55,8 @@ export default function App({ Component, pageProps }: AppProps) {
useEffect(() => {
setupI18n().finally(() => setIsI18nReady(true));
+ logUnhandledErrorsAndRejections(true);
+ return () => logUnhandledErrorsAndRejections(false);
}, []);
const setupPackageName = () => {
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsx
index bd59ac2255..bf1093c907 100644
--- a/web/apps/auth/src/pages/_app.tsx
+++ b/web/apps/auth/src/pages/_app.tsx
@@ -1,6 +1,9 @@
import { CustomHead } from "@/next/components/Head";
import { setupI18n } from "@/next/i18n";
-import { logStartupBanner } from "@/next/log-web";
+import {
+ logStartupBanner,
+ logUnhandledErrorsAndRejections,
+} from "@/next/log-web";
import {
APPS,
APP_TITLES,
@@ -68,9 +71,11 @@ export default function App({ Component, pageProps }: AppProps) {
setupI18n().finally(() => setIsI18nReady(true));
const userId = (getData(LS_KEYS.USER) as User)?.id;
logStartupBanner(APPS.AUTH, userId);
+ logUnhandledErrorsAndRejections(true);
HTTPService.setHeaders({
"X-Client-Package": CLIENT_PACKAGE_NAMES.get(APPS.AUTH),
});
+ return () => logUnhandledErrorsAndRejections(false);
}, []);
const setUserOnline = () => setOffline(false);
diff --git a/web/apps/cast/src/pages/_app.tsx b/web/apps/cast/src/pages/_app.tsx
index 3f22f687c8..99b047d416 100644
--- a/web/apps/cast/src/pages/_app.tsx
+++ b/web/apps/cast/src/pages/_app.tsx
@@ -1,12 +1,20 @@
import { CustomHead } from "@/next/components/Head";
+import { logUnhandledErrorsAndRejections } from "@/next/log-web";
import { APPS, APP_TITLES } from "@ente/shared/apps/constants";
import { getTheme } from "@ente/shared/themes";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import { CssBaseline, ThemeProvider } from "@mui/material";
import type { AppProps } from "next/app";
+import { useEffect } from "react";
+
import "styles/global.css";
export default function App({ Component, pageProps }: AppProps) {
+ useEffect(() => {
+ logUnhandledErrorsAndRejections(true);
+ return () => logUnhandledErrorsAndRejections(false);
+ }, []);
+
return (
<>
<CustomHead title={APP_TITLES.get(APPS.PHOTOS)} />
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index 0b57586094..06961d6c9b 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -154,9 +154,7 @@ export default function App({ Component, pageProps }: AppProps) {
HTTPService.setHeaders({
"X-Client-Package": CLIENT_PACKAGE_NAMES.get(APPS.PHOTOS),
});
- return () => {
- logUnhandledErrorsAndRejections(false);
- };
+ return () => logUnhandledErrorsAndRejections(false);
}, []);
useEffect(() => {