Fix
This commit is contained in:
@@ -6,7 +6,7 @@ import { AttributedMiniDialog } from "@/base/components/MiniDialog";
|
||||
import { useAttributedMiniDialog } from "@/base/components/utils/dialog";
|
||||
import { useSetupI18n, useSetupLogs } from "@/base/components/utils/hooks-app";
|
||||
import { photosTheme } from "@/base/components/utils/theme";
|
||||
import { BaseContext } from "@/base/context";
|
||||
import { BaseContext, deriveBaseContext } from "@/base/context";
|
||||
import "@fontsource-variable/inter";
|
||||
import { CssBaseline } from "@mui/material";
|
||||
import { ThemeProvider } from "@mui/material/styles";
|
||||
@@ -29,7 +29,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
|
||||
}, []);
|
||||
|
||||
const baseContext = useMemo(
|
||||
() => ({ logout, showMiniDialog }),
|
||||
() => deriveBaseContext({ logout, showMiniDialog }),
|
||||
[logout, showMiniDialog],
|
||||
);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
useSetupLogs,
|
||||
} from "@/base/components/utils/hooks-app";
|
||||
import { authTheme } from "@/base/components/utils/theme";
|
||||
import { BaseContext } from "@/base/context";
|
||||
import { BaseContext, deriveBaseContext } 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";
|
||||
@@ -43,7 +43,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
|
||||
}, []);
|
||||
|
||||
const baseContext = useMemo(
|
||||
() => ({ logout, showMiniDialog }),
|
||||
() => deriveBaseContext({ logout, showMiniDialog }),
|
||||
[logout, showMiniDialog],
|
||||
);
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ import {
|
||||
import { t } from "i18next";
|
||||
import React, { useEffect, useReducer, useState } from "react";
|
||||
import type { FaceCluster } from "../../services/ml/cluster";
|
||||
import { usePhotosAppContext } from "../../types/context";
|
||||
import { SuggestionFaceList } from "../PeopleList";
|
||||
import {
|
||||
ItemCard,
|
||||
@@ -546,8 +545,7 @@ const SuggestionsDialog: React.FC<SuggestionsDialogProps> = ({
|
||||
onClose,
|
||||
person,
|
||||
}) => {
|
||||
const { showMiniDialog } = useBaseContext();
|
||||
const { onGenericError } = usePhotosAppContext();
|
||||
const { showMiniDialog, onGenericError } = useBaseContext();
|
||||
|
||||
const [state, dispatch] = useReducer(
|
||||
suggestionsDialogReducer,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useBaseContext } from "@/base/context";
|
||||
import { useCallback } from "react";
|
||||
import { usePhotosAppContext } from "../../types/context";
|
||||
|
||||
@@ -19,8 +20,8 @@ import { usePhotosAppContext } from "../../types/context";
|
||||
export const useWrapAsyncOperation = <T extends unknown[]>(
|
||||
f: (...args: T) => Promise<void>,
|
||||
) => {
|
||||
const { showLoadingBar, hideLoadingBar, onGenericError } =
|
||||
usePhotosAppContext();
|
||||
const { onGenericError } = useBaseContext();
|
||||
const { showLoadingBar, hideLoadingBar } = usePhotosAppContext();
|
||||
return useCallback(
|
||||
async (...args: T) => {
|
||||
showLoadingBar();
|
||||
|
||||
Reference in New Issue
Block a user