Fix pathname comparison while served on subpath

This commit is contained in:
schroda
2026-05-13 00:12:43 +02:00
parent 17ecb7da27
commit 7fa106cd2c
4 changed files with 11 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed
- (**Migration**) Fix aborting bulk migration search/execution while webUI is served on a subpath
- (**Reader**) Fix scrollbar appearing with "fit to widt/height/screen" page scale mode and applied safe area insets
- (**Reader**) Fix wrongly positioned mobile progress bar current page indicator
- (**Reader**) Fix mobile progress bar previous/next chapter button visibility on hover and while disabled

View File

@@ -21,6 +21,7 @@ import { useMetadataServerSettings } from '@/features/settings/services/ServerSe
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { STABLE_EMPTY_OBJECT } from '@/base/Base.constants.ts';
import { SubpathUtil } from '@/lib/utils/SubpathUtil.ts';
const disabledUpdateCheck = () => Promise.resolve();
@@ -92,7 +93,7 @@ export const ServerUpdateChecker = () => {
return null;
}
const isAboutPage = window.location.pathname === AppRoutes.about.path;
const isAboutPage = SubpathUtil.getPathname() === AppRoutes.about.path;
if (isAboutPage) {
return null;
}

View File

@@ -19,13 +19,14 @@ import { BrowseTab } from '@/features/browse/Browse.types.ts';
import { useAppPageHistoryContext } from '@/base/contexts/AppPageHistoryContext.tsx';
import { useEffect } from 'react';
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
import { SubpathUtil } from '@/lib/utils/SubpathUtil.ts';
export const Migration = ({ tabsMenuHeight = 0 }: { tabsMenuHeight?: number }) => {
const phase = MigrationManager.usePhase();
const { setOnBack } = useAppPageHistoryContext();
useEffect(() => {
if (window.location.pathname !== AppRoutes.migrate.path) {
if (SubpathUtil.getPathname() !== AppRoutes.migrate.path) {
if (!MigrationManager.isActive()) {
MigrationManager.reset();
} else {

View File

@@ -44,4 +44,10 @@ export class SubpathUtil {
return `${baseUrl}${subpath}`;
}
public static getPathname(): string {
const subpath = this.getSubpath();
return window.location.pathname.replace(subpath, '');
}
}