feat(library): a maximised window leaves the phone frame
This commit is contained in:
@@ -373,6 +373,18 @@ function Catalogue({ admin, user }: { admin: boolean; user: User | null }) {
|
||||
const detectedMobile = useIsMobile(860);
|
||||
const isMobile = forceView === 'mobile' || (forceView === 'auto' && detectedMobile);
|
||||
|
||||
// The phone frame belongs to a narrow window. A desktop browser that drags its
|
||||
// title bar to the top of the screen, or presses maximise, is a window with the
|
||||
// room for the desktop layout again — so the frame is let go, and only there:
|
||||
// a phone never widens past the breakpoint, and a window still narrow keeps it.
|
||||
useEffect(() => {
|
||||
const onResize = () => {
|
||||
if (forceView === 'mobile' && window.innerWidth > 860) setForceView('auto');
|
||||
};
|
||||
window.addEventListener('resize', onResize);
|
||||
return () => window.removeEventListener('resize', onResize);
|
||||
}, [forceView]);
|
||||
|
||||
const [folders, setFolders] = useState<LibraryFolder[]>(() => cachedFolders());
|
||||
const [ready, setReady] = useState<Set<string>>(new Set());
|
||||
// The Immich servers this account has saved, and the two dialogs that write
|
||||
|
||||
Reference in New Issue
Block a user