Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web][photos] Own offline status in navigation shell

AswinAsoka1b9c24042af
diff --git a/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx b/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
index 405d9dda29..79f7b3baf9 100644
--- a/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
+++ b/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
@@ -1,5 +1,6 @@
import { CreateAlbumDialog } from "@/components/collections/CreateAlbumDialog";
import { SearchBar, type SearchBarProps } from "@/components/SearchBar";
+import { useIsOffline } from "@/components/utils/use-is-offline";
import { uploadManager } from "@/services/upload-manager";
import {
Album02Icon,
@@ -62,19 +63,20 @@ export const PhotosNavigationShell: React.FC<
React.PropsWithChildren<
PhotosNavigationShellProps & {
isFirstLoad: boolean;
- isOffline: boolean;
+ isCleanupViewOpen: boolean;
alternateHeader: ReactNode;
galleryNavigation: GalleryNavigation | undefined;
}
>
> = ({
isFirstLoad,
- isOffline,
+ isCleanupViewOpen,
alternateHeader,
galleryNavigation,
children,
...props
}) => {
+ const isOffline = useIsOffline();
const [railOpen, setRailOpen] = useState(true);
const [navigationCollapsed, setNavigationCollapsed] = useState(false);
const toggleRail = () => setRailOpen((open) => !open);
@@ -268,8 +270,12 @@ export const PhotosNavigationShell: React.FC<
>
{children}
</Stack>
- {isFirstLoad && <FirstLoadMessage />}
- {isOffline && <OfflineMessage />}
+ {!isCleanupViewOpen && (
+ <>
+ {isFirstLoad && <FirstLoadMessage />}
+ {isOffline && <OfflineMessage />}
+ </>
+ )}
</Stack>
</Stack>
</Stack>
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 626cd18dd9..61df234d88 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -58,7 +58,6 @@ import {
notifyUnsupportedSharedFavoritesDialogAttributes,
trashFilesDialogAttributes,
} from "@/components/utils/dialog-attributes";
-import { useIsOffline } from "@/components/utils/use-is-offline";
import { shouldShowWhatsNew } from "@/services/changelog";
import exportService from "@/services/export";
import { processPendingAlbumJoin } from "@/services/join-album";
@@ -201,7 +200,6 @@ const Page: React.FC = () => {
showNotification,
} = usePhotosAppContext();
- const isOffline = useIsOffline();
const [state, dispatch] = useGalleryReducer();
const [cleanupView, setCleanupView] = useState<
@@ -2187,8 +2185,8 @@ const Page: React.FC = () => {
onRemotePull={remotePull}
/>
<PhotosNavigationShell
- isFirstLoad={!isCleanupViewOpen && isFirstLoad}
- isOffline={!isCleanupViewOpen && isOffline}
+ isFirstLoad={isFirstLoad}
+ isCleanupViewOpen={isCleanupViewOpen}
isInSearchMode={isInSearchMode}
isSettingsOpen={sidebarVisibilityProps.open}
mode={barMode}