diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerEditPanel.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerEditPanel.tsx index 0ffa09c32a..eefbba3c8b 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerEditPanel.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerEditPanel.tsx @@ -53,6 +53,7 @@ import { formatCustomFieldInput, } from "src/components/Shared/CustomFields"; import cloneDeep from "lodash-es/cloneDeep"; +import { handleUnsavedChanges } from "src/utils/navigation"; const isScraper = ( scraper: GQL.Scraper | GQL.StashBox @@ -714,7 +715,9 @@ export const PerformerEditPanel: React.FC = ({ + handleUnsavedChanges(intl, "performers", performer.id)(location) + } /> {renderButtons("mb-3")} diff --git a/ui/v2.5/src/utils/navigation.ts b/ui/v2.5/src/utils/navigation.ts index 0f6f259be6..f0ee9f807e 100644 --- a/ui/v2.5/src/utils/navigation.ts +++ b/ui/v2.5/src/utils/navigation.ts @@ -469,7 +469,11 @@ export function handleUnsavedChanges( ) { return (location: { pathname: string }) => { // #2291 - don't prompt if we're navigating within the gallery being edited - if (id !== undefined && location.pathname === `/${basepath}/${id}`) { + // #7154 - don't prompt on lightbox navigation + const regex = new RegExp( + `^\\/${basepath}\\/${id}(\\/(default|scenes|galleries|images|groups|appearswith|performers|subgroups))?$` + ); + if (id !== undefined && regex.test(location.pathname)) { return true; }