Fix pathname comparison while served on subpath
This commit is contained in:
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
|
|
||||||
### Fixed
|
### 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 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 wrongly positioned mobile progress bar current page indicator
|
||||||
- (**Reader**) Fix mobile progress bar previous/next chapter button visibility on hover and while disabled
|
- (**Reader**) Fix mobile progress bar previous/next chapter button visibility on hover and while disabled
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { useMetadataServerSettings } from '@/features/settings/services/ServerSe
|
|||||||
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
|
||||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||||
import { STABLE_EMPTY_OBJECT } from '@/base/Base.constants.ts';
|
import { STABLE_EMPTY_OBJECT } from '@/base/Base.constants.ts';
|
||||||
|
import { SubpathUtil } from '@/lib/utils/SubpathUtil.ts';
|
||||||
|
|
||||||
const disabledUpdateCheck = () => Promise.resolve();
|
const disabledUpdateCheck = () => Promise.resolve();
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ export const ServerUpdateChecker = () => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAboutPage = window.location.pathname === AppRoutes.about.path;
|
const isAboutPage = SubpathUtil.getPathname() === AppRoutes.about.path;
|
||||||
if (isAboutPage) {
|
if (isAboutPage) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,13 +19,14 @@ import { BrowseTab } from '@/features/browse/Browse.types.ts';
|
|||||||
import { useAppPageHistoryContext } from '@/base/contexts/AppPageHistoryContext.tsx';
|
import { useAppPageHistoryContext } from '@/base/contexts/AppPageHistoryContext.tsx';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
|
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
|
||||||
|
import { SubpathUtil } from '@/lib/utils/SubpathUtil.ts';
|
||||||
|
|
||||||
export const Migration = ({ tabsMenuHeight = 0 }: { tabsMenuHeight?: number }) => {
|
export const Migration = ({ tabsMenuHeight = 0 }: { tabsMenuHeight?: number }) => {
|
||||||
const phase = MigrationManager.usePhase();
|
const phase = MigrationManager.usePhase();
|
||||||
const { setOnBack } = useAppPageHistoryContext();
|
const { setOnBack } = useAppPageHistoryContext();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.location.pathname !== AppRoutes.migrate.path) {
|
if (SubpathUtil.getPathname() !== AppRoutes.migrate.path) {
|
||||||
if (!MigrationManager.isActive()) {
|
if (!MigrationManager.isActive()) {
|
||||||
MigrationManager.reset();
|
MigrationManager.reset();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -44,4 +44,10 @@ export class SubpathUtil {
|
|||||||
|
|
||||||
return `${baseUrl}${subpath}`;
|
return `${baseUrl}${subpath}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static getPathname(): string {
|
||||||
|
const subpath = this.getSubpath();
|
||||||
|
|
||||||
|
return window.location.pathname.replace(subpath, '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user