pwa: save a page reload between library and reader page navigation (#231)

This commit is contained in:
Huang Xin
2025-01-23 14:44:14 +01:00
committed by GitHub
parent 6315e4b751
commit d757555fcb
+2 -2
View File
@@ -1,5 +1,5 @@
import { useRouter } from 'next/navigation';
import { isWebAppPlatform } from '@/services/environment';
import { isPWA, isWebAppPlatform } from '@/services/environment';
import { BOOK_IDS_SEPARATOR } from '@/services/constants';
export const navigateToReader = (
@@ -9,7 +9,7 @@ export const navigateToReader = (
navOptions?: { scroll?: boolean },
) => {
const ids = bookIds.join(BOOK_IDS_SEPARATOR);
if (isWebAppPlatform()) {
if (isWebAppPlatform() && !isPWA()) {
router.push(`/reader/${ids}${queryParams ? `?${queryParams}` : ''}`, navOptions);
} else {
const params = new URLSearchParams(queryParams || '');