feat(onDelete): Redirect to previous page to preserve filters (#5818)

This commit is contained in:
Rémi Marseault
2025-06-02 09:12:17 +02:00
committed by GitHub
parent 91ac2833f5
commit 86848e7d70
7 changed files with 11 additions and 11 deletions

View File

@@ -167,7 +167,7 @@ export const GalleryPage: React.FC<IProps> = ({ gallery, add }) => {
function onDeleteDialogClosed(deleted: boolean) {
setIsDeleteAlertOpen(false);
if (deleted) {
history.push("/galleries");
history.goBack();
}
}

View File

@@ -252,10 +252,10 @@ const GroupPage: React.FC<IProps> = ({ group, tabKey }) => {
await deleteGroup();
} catch (e) {
Toast.error(e);
return;
}
// redirect to groups page
history.push(`/groups`);
history.goBack();
}
function toggleEditing(value?: boolean) {

View File

@@ -156,7 +156,7 @@ const ImagePage: React.FC<IProps> = ({ image }) => {
function onDeleteDialogClosed(deleted: boolean) {
setIsDeleteAlertOpen(false);
if (deleted) {
history.push("/images");
history.goBack();
}
}

View File

@@ -298,10 +298,10 @@ const PerformerPage: React.FC<IProps> = PatchComponent(
await deletePerformer({ variables: { id: performer.id } });
} catch (e) {
Toast.error(e);
return;
}
// redirect to performers page
history.push("/performers");
history.goBack();
}
function toggleEditing(value?: boolean) {

View File

@@ -909,7 +909,7 @@ const SceneLoader: React.FC<RouteComponentProps<ISceneParams>> = ({
) {
loadScene(queueScenes[currentQueueIndex + 1].id);
} else {
history.push("/scenes");
history.goBack();
}
}

View File

@@ -375,10 +375,10 @@ const StudioPage: React.FC<IProps> = ({ studio, tabKey }) => {
await deleteStudio();
} catch (e) {
Toast.error(e);
return;
}
// redirect to studios page
history.push(`/studios`);
history.goBack();
}
function renderDeleteAlert() {

View File

@@ -417,10 +417,10 @@ const TagPage: React.FC<IProps> = ({ tag, tabKey }) => {
});
} catch (e) {
Toast.error(e);
return;
}
// redirect to tags page
history.push(`/tags`);
history.goBack();
}
function renderDeleteAlert() {