π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
More
Manav Rathi3d2d0cc3454f
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsxindex 68a94d7fb1..9879b4709e 100644--- a/web/apps/auth/src/pages/_app.tsx+++ b/web/apps/auth/src/pages/_app.tsx@@ -13,6 +13,7 @@ import {useSetupLogs,} from "@/base/components/utils/hooks-app";import { authTheme } from "@/base/components/utils/theme";+import { BaseContext } from "@/base/context";import { logStartupBanner } from "@/base/log-web";import HTTPService from "@ente/shared/network/HTTPService";import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";@@ -42,6 +43,11 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {void accountLogout().then(() => window.location.replace("/"));}, []);+ const baseContext = useMemo(+ () => ({ showMiniDialog, logout }),+ [showMiniDialog, logout],+ );+const appContext = useMemo(() => ({logout,@@ -61,16 +67,20 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {<AttributedMiniDialog {...miniDialogProps} />- <AppContext.Provider value={appContext}>- {!isI18nReady ? (- <LoadingIndicator />- ) : (- <>- {isChangingRoute && <TranslucentLoadingOverlay />}- <Component {...pageProps} />- </>- )}- </AppContext.Provider>+ <BaseContext value={baseContext}>+ <AppContext.Provider value={appContext}>+ {!isI18nReady ? (+ <LoadingIndicator />+ ) : (+ <>+ {isChangingRoute && (+ <TranslucentLoadingOverlay />+ )}+ <Component {...pageProps} />+ </>+ )}+ </AppContext.Provider>+ </BaseContext></ThemeProvider></>);diff --git a/web/packages/base/context.ts b/web/packages/base/context.tsindex 96e1fe302b..07eea8b982 100644--- a/web/packages/base/context.ts+++ b/web/packages/base/context.ts@@ -8,10 +8,6 @@ import { createContext, useContext } from "react";* It is usually provided by the _app.tsx for the corresponding app.*/export interface BaseContextT {- /**- * Perform the (possibly app specific) logout sequence.- */- logout: () => void;/*** Show a "mini dialog" with the given attributes.*@@ -20,6 +16,10 @@ export interface BaseContextT {* customized by providing appropriate {@link MiniDialogAttributes}.*/showMiniDialog: (attributes: MiniDialogAttributes) => void;+ /**+ * Perform the (possibly app specific) logout sequence.+ */+ logout: () => void;}/**