mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
feat(onDelete): Redirect to previous page to preserve filters (#5818)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -156,7 +156,7 @@ const ImagePage: React.FC<IProps> = ({ image }) => {
|
||||
function onDeleteDialogClosed(deleted: boolean) {
|
||||
setIsDeleteAlertOpen(false);
|
||||
if (deleted) {
|
||||
history.push("/images");
|
||||
history.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -909,7 +909,7 @@ const SceneLoader: React.FC<RouteComponentProps<ISceneParams>> = ({
|
||||
) {
|
||||
loadScene(queueScenes[currentQueueIndex + 1].id);
|
||||
} else {
|
||||
history.push("/scenes");
|
||||
history.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user