From 626dd2fbd76164d9d41042a33d95132580e2e605 Mon Sep 17 00:00:00 2001 From: chrox Date: Wed, 4 Dec 2024 13:20:08 +0100 Subject: [PATCH] Fix headerbar start-dragging events --- .../src/app/library/components/LibraryHeader.tsx | 2 +- apps/readest-app/src/app/library/page.tsx | 7 +++---- apps/readest-app/src/app/reader/components/HeaderBar.tsx | 2 +- apps/readest-app/src/app/reader/components/ViewMenu.tsx | 1 - apps/readest-app/src/components/WindowButtons.tsx | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/readest-app/src/app/library/components/LibraryHeader.tsx b/apps/readest-app/src/app/library/components/LibraryHeader.tsx index b77b2b9a..ad686219 100644 --- a/apps/readest-app/src/app/library/components/LibraryHeader.tsx +++ b/apps/readest-app/src/app/library/components/LibraryHeader.tsx @@ -42,7 +42,7 @@ const LibraryHeader: React.FC = ({ )} >
-
+
diff --git a/apps/readest-app/src/app/library/page.tsx b/apps/readest-app/src/app/library/page.tsx index a33f9826..a2faeee7 100644 --- a/apps/readest-app/src/app/library/page.tsx +++ b/apps/readest-app/src/app/library/page.tsx @@ -27,7 +27,7 @@ const LibraryPage = () => { const { setSettings } = useSettingsStore(); const [loading, setLoading] = useState(false); const isInitiating = useRef(false); - const libraryLoaded = useRef(false); + const [libraryLoaded, setLibraryLoaded] = useState(false); const [isSelectMode, setIsSelectMode] = useState(false); const processOpenWithFiles = React.useCallback( @@ -68,8 +68,7 @@ const LibraryPage = () => { setLibrary(libraryBooks); } - libraryLoaded.current = true; - + setLibraryLoaded(true); if (loadingTimeout) clearTimeout(loadingTimeout); setLoading(false); }; @@ -152,7 +151,7 @@ const LibraryPage = () => {
)} - {libraryLoaded.current && + {libraryLoaded && (libraryBooks.length > 0 ? (
= ({
} onToggle={handleToggleDropdown} diff --git a/apps/readest-app/src/app/reader/components/ViewMenu.tsx b/apps/readest-app/src/app/reader/components/ViewMenu.tsx index 03f6ee9e..51222647 100644 --- a/apps/readest-app/src/app/reader/components/ViewMenu.tsx +++ b/apps/readest-app/src/app/reader/components/ViewMenu.tsx @@ -86,7 +86,6 @@ const ViewMenu: React.FC = ({ return (
diff --git a/apps/readest-app/src/components/WindowButtons.tsx b/apps/readest-app/src/components/WindowButtons.tsx index 664a418e..73fbe03d 100644 --- a/apps/readest-app/src/components/WindowButtons.tsx +++ b/apps/readest-app/src/components/WindowButtons.tsx @@ -48,7 +48,7 @@ const WindowButtons: React.FC = ({ if ( target.closest('.btn') || target.closest('.window-button') || - target.closest('#exclude-title-bar-mousedown') + target.closest('.exclude-title-bar-mousedown') ) { return; }