diff --git a/apps/readest-app/next.config.mjs b/apps/readest-app/next.config.mjs index 0ca356d0..217d16e9 100644 --- a/apps/readest-app/next.config.mjs +++ b/apps/readest-app/next.config.mjs @@ -1,11 +1,13 @@ import withPWAInit from '@ducanh2912/next-pwa'; import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare'; -initOpenNextCloudflareForDev(); - const isDev = process.env['NODE_ENV'] === 'development'; const appPlatform = process.env['NEXT_PUBLIC_APP_PLATFORM']; +if (isDev) { + initOpenNextCloudflareForDev(); +} + /** @type {import('next').NextConfig} */ const nextConfig = { // Ensure Next.js uses SSG instead of SSR diff --git a/apps/readest-app/src/app/library/page.tsx b/apps/readest-app/src/app/library/page.tsx index 6d245114..1f250aad 100644 --- a/apps/readest-app/src/app/library/page.tsx +++ b/apps/readest-app/src/app/library/page.tsx @@ -218,6 +218,13 @@ const LibraryPageContent = ({ searchParams }: { searchParams: ReadonlyURLSearchP // eslint-disable-next-line react-hooks/exhaustive-deps }, [pageRef.current]); + useEffect(() => { + if (!libraryBooks.some((book) => !book.deletedAt)) { + handleSetSelectMode(false); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [libraryBooks]); + const processOpenWithFiles = React.useCallback( async (appService: AppService, openWithFiles: string[], libraryBooks: Book[]) => { const settings = await appService.loadSettings();