mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Cleanup
This commit is contained in:
parent
52866bdc8e
commit
bf8e271088
@ -140,13 +140,8 @@ const CollectionOptions: React.FC<CollectionOptionsProps> = ({
|
||||
setFilesDownloadProgressAttributesCreator,
|
||||
isActiveCollectionDownloadInProgress,
|
||||
}) => {
|
||||
const {
|
||||
showLoadingBar,
|
||||
hideLoadingBar,
|
||||
onGenericError,
|
||||
setDialogMessage,
|
||||
showMiniDialog,
|
||||
} = useAppContext();
|
||||
const { showLoadingBar, hideLoadingBar, onGenericError, showMiniDialog } =
|
||||
useAppContext();
|
||||
const { syncWithRemote } = useContext(GalleryContext);
|
||||
const overFlowMenuIconRef = useRef<SVGSVGElement>(null);
|
||||
|
||||
|
@ -26,8 +26,6 @@ import { runMigrations } from "@/new/photos/services/migrations";
|
||||
import { initML, isMLSupported } from "@/new/photos/services/ml";
|
||||
import { getFamilyPortalRedirectURL } from "@/new/photos/services/user-details";
|
||||
import { AppContext } from "@/new/photos/types/context";
|
||||
import DialogBox from "@ente/shared/components/DialogBox";
|
||||
import { DialogBoxAttributes } from "@ente/shared/components/DialogBox/types";
|
||||
import { MessageContainer } from "@ente/shared/components/MessageContainer";
|
||||
import { useLocalState } from "@ente/shared/hooks/useLocalState";
|
||||
import HTTPService from "@ente/shared/network/HTTPService";
|
||||
@ -64,8 +62,6 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
typeof window !== "undefined" && !window.navigator.onLine,
|
||||
);
|
||||
const [showNavbar, setShowNavBar] = useState(false);
|
||||
const [dialogMessage, setDialogMessage] = useState<DialogBoxAttributes>();
|
||||
const [messageDialogView, setMessageDialogView] = useState(false);
|
||||
const [watchFolderView, setWatchFolderView] = useState(false);
|
||||
const [watchFolderFiles, setWatchFolderFiles] = useState<FileList>(null);
|
||||
const [notificationView, setNotificationView] = useState(false);
|
||||
@ -181,10 +177,6 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setMessageDialogView(true);
|
||||
}, [dialogMessage]);
|
||||
|
||||
useEffect(() => {
|
||||
setNotificationView(true);
|
||||
}, [notificationAttributes]);
|
||||
@ -209,7 +201,6 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
showNavBar,
|
||||
showLoadingBar,
|
||||
hideLoadingBar,
|
||||
setDialogMessage,
|
||||
watchFolderView,
|
||||
setWatchFolderView,
|
||||
watchFolderFiles,
|
||||
@ -236,13 +227,6 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||
</MessageContainer>
|
||||
<LoadingBar color="#51cd7c" ref={loadingBarRef} />
|
||||
|
||||
<DialogBox
|
||||
sx={{ zIndex: photosDialogZIndex }}
|
||||
size="xs"
|
||||
open={messageDialogView}
|
||||
onClose={() => setMessageDialogView(false)}
|
||||
attributes={dialogMessage}
|
||||
/>
|
||||
<AttributedMiniDialog
|
||||
sx={{ zIndex: photosDialogZIndex }}
|
||||
{...miniDialogProps}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import type { AccountsContextT } from "@/accounts/types/context";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import type { SetDialogBoxAttributes } from "@ente/shared/components/DialogBox/types";
|
||||
import { THEME_COLOR } from "@ente/shared/themes/constants";
|
||||
import { createContext, useContext } from "react";
|
||||
import type { SetNotificationAttributes } from "./notification";
|
||||
@ -22,10 +21,6 @@ export type AppContextT = AccountsContextT & {
|
||||
* Show a generic error dialog, and log the given error.
|
||||
*/
|
||||
onGenericError: (error: unknown) => void;
|
||||
/**
|
||||
* Deprecated, use showMiniDialog instead.
|
||||
*/
|
||||
setDialogMessage: SetDialogBoxAttributes;
|
||||
setNotificationAttributes: SetNotificationAttributes;
|
||||
watchFolderView: boolean;
|
||||
setWatchFolderView: (isOpen: boolean) => void;
|
||||
|
@ -34,7 +34,3 @@ export interface DialogBoxAttributes {
|
||||
disabled?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export type SetDialogBoxAttributes = React.Dispatch<
|
||||
React.SetStateAction<DialogBoxAttributes>
|
||||
>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user