From 289966672414a15f507108f160268c28eaff4e9b Mon Sep 17 00:00:00 2001 From: gallery Date: Sun, 15 Nov 2026 23:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=89=93=E5=BC=80=E8=AF=A6=E6=83=85=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/Pages/SharePage/AlbumSharePage.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/src/Pages/SharePage/AlbumSharePage.tsx b/ui/src/Pages/SharePage/AlbumSharePage.tsx index 8d132f8..02427d1 100644 --- a/ui/src/Pages/SharePage/AlbumSharePage.tsx +++ b/ui/src/Pages/SharePage/AlbumSharePage.tsx @@ -141,9 +141,18 @@ const AlbumSharePage = ({ albumID, token, password }: AlbumSharePageProps) => { const album = data?.album // Open the detail sidebar with the first (newest) photo when the page loads. + // On small screens the sidebar is a full-screen drawer, so leave it closed. useEffect(() => { if (!album || openedAlbumID.current === album.id) return + if ( + typeof window === 'undefined' || + typeof window.matchMedia !== 'function' || + !window.matchMedia('(min-width: 1024px)').matches + ) { + return + } + const firstMedia = album.media[0] if (!firstMedia) return