Skip to content

Commit 86848e7

Browse files
authored
feat(onDelete): Redirect to previous page to preserve filters (#5818)
1 parent 91ac283 commit 86848e7

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const GalleryPage: React.FC<IProps> = ({ gallery, add }) => {
167167
function onDeleteDialogClosed(deleted: boolean) {
168168
setIsDeleteAlertOpen(false);
169169
if (deleted) {
170-
history.push("/galleries");
170+
history.goBack();
171171
}
172172
}
173173

ui/v2.5/src/components/Groups/GroupDetails/Group.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ const GroupPage: React.FC<IProps> = ({ group, tabKey }) => {
252252
await deleteGroup();
253253
} catch (e) {
254254
Toast.error(e);
255+
return;
255256
}
256257

257-
// redirect to groups page
258-
history.push(`/groups`);
258+
history.goBack();
259259
}
260260

261261
function toggleEditing(value?: boolean) {

ui/v2.5/src/components/Images/ImageDetails/Image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const ImagePage: React.FC<IProps> = ({ image }) => {
156156
function onDeleteDialogClosed(deleted: boolean) {
157157
setIsDeleteAlertOpen(false);
158158
if (deleted) {
159-
history.push("/images");
159+
history.goBack();
160160
}
161161
}
162162

ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ const PerformerPage: React.FC<IProps> = PatchComponent(
298298
await deletePerformer({ variables: { id: performer.id } });
299299
} catch (e) {
300300
Toast.error(e);
301+
return;
301302
}
302303

303-
// redirect to performers page
304-
history.push("/performers");
304+
history.goBack();
305305
}
306306

307307
function toggleEditing(value?: boolean) {

ui/v2.5/src/components/Scenes/SceneDetails/Scene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ const SceneLoader: React.FC<RouteComponentProps<ISceneParams>> = ({
909909
) {
910910
loadScene(queueScenes[currentQueueIndex + 1].id);
911911
} else {
912-
history.push("/scenes");
912+
history.goBack();
913913
}
914914
}
915915

ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@ const StudioPage: React.FC<IProps> = ({ studio, tabKey }) => {
375375
await deleteStudio();
376376
} catch (e) {
377377
Toast.error(e);
378+
return;
378379
}
379380

380-
// redirect to studios page
381-
history.push(`/studios`);
381+
history.goBack();
382382
}
383383

384384
function renderDeleteAlert() {

ui/v2.5/src/components/Tags/TagDetails/Tag.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ const TagPage: React.FC<IProps> = ({ tag, tabKey }) => {
417417
});
418418
} catch (e) {
419419
Toast.error(e);
420+
return;
420421
}
421422

422-
// redirect to tags page
423-
history.push(`/tags`);
423+
history.goBack();
424424
}
425425

426426
function renderDeleteAlert() {

0 commit comments

Comments
 (0)