mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +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) {
|
function onDeleteDialogClosed(deleted: boolean) {
|
||||||
setIsDeleteAlertOpen(false);
|
setIsDeleteAlertOpen(false);
|
||||||
if (deleted) {
|
if (deleted) {
|
||||||
history.push("/galleries");
|
history.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,10 +252,10 @@ const GroupPage: React.FC<IProps> = ({ group, tabKey }) => {
|
|||||||
await deleteGroup();
|
await deleteGroup();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error(e);
|
Toast.error(e);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to groups page
|
history.goBack();
|
||||||
history.push(`/groups`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEditing(value?: boolean) {
|
function toggleEditing(value?: boolean) {
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ const ImagePage: React.FC<IProps> = ({ image }) => {
|
|||||||
function onDeleteDialogClosed(deleted: boolean) {
|
function onDeleteDialogClosed(deleted: boolean) {
|
||||||
setIsDeleteAlertOpen(false);
|
setIsDeleteAlertOpen(false);
|
||||||
if (deleted) {
|
if (deleted) {
|
||||||
history.push("/images");
|
history.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -298,10 +298,10 @@ const PerformerPage: React.FC<IProps> = PatchComponent(
|
|||||||
await deletePerformer({ variables: { id: performer.id } });
|
await deletePerformer({ variables: { id: performer.id } });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error(e);
|
Toast.error(e);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to performers page
|
history.goBack();
|
||||||
history.push("/performers");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEditing(value?: boolean) {
|
function toggleEditing(value?: boolean) {
|
||||||
|
|||||||
@@ -909,7 +909,7 @@ const SceneLoader: React.FC<RouteComponentProps<ISceneParams>> = ({
|
|||||||
) {
|
) {
|
||||||
loadScene(queueScenes[currentQueueIndex + 1].id);
|
loadScene(queueScenes[currentQueueIndex + 1].id);
|
||||||
} else {
|
} else {
|
||||||
history.push("/scenes");
|
history.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -375,10 +375,10 @@ const StudioPage: React.FC<IProps> = ({ studio, tabKey }) => {
|
|||||||
await deleteStudio();
|
await deleteStudio();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error(e);
|
Toast.error(e);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to studios page
|
history.goBack();
|
||||||
history.push(`/studios`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDeleteAlert() {
|
function renderDeleteAlert() {
|
||||||
|
|||||||
@@ -417,10 +417,10 @@ const TagPage: React.FC<IProps> = ({ tag, tabKey }) => {
|
|||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error(e);
|
Toast.error(e);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to tags page
|
history.goBack();
|
||||||
history.push(`/tags`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDeleteAlert() {
|
function renderDeleteAlert() {
|
||||||
|
|||||||
Reference in New Issue
Block a user