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) { function onDeleteDialogClosed(deleted: boolean) {
setIsDeleteAlertOpen(false); setIsDeleteAlertOpen(false);
if (deleted) { if (deleted) {
history.push("/galleries"); history.goBack();
} }
} }

View File

@@ -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) {

View File

@@ -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();
} }
} }

View File

@@ -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) {

View File

@@ -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();
} }
} }

View File

@@ -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() {

View File

@@ -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() {