Skip to content

Commit

Permalink
fix sequence deletion navigate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Oct 31, 2024
1 parent f25ea64 commit cca76b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/folders/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const SequenceButtonCluster =
className={"fa fa-trash cluster-icon"}
title={t("delete sequence")}
onClick={deleteSequence({
navigate,
sequenceUuid: sequence.uuid,
getWebAppConfigValue,
dispatch,
Expand Down
5 changes: 3 additions & 2 deletions frontend/sequences/sequence_editor_middle_active.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export const SequenceBtnGroup = ({
<i className={"fa fa-trash fb-icon-button"}
title={t("delete sequence")}
onClick={deleteSequence({
navigate,
sequenceUuid: sequence.uuid,
getWebAppConfigValue,
dispatch,
Expand Down Expand Up @@ -353,6 +354,7 @@ export const SequenceBtnGroup = ({
};

interface DeleteSequenceProps {
navigate(url: string): void;
getWebAppConfigValue: GetWebAppConfigValue;
dispatch: Function;
sequenceUuid: UUID;
Expand All @@ -362,9 +364,8 @@ export const deleteSequence = (props: DeleteSequenceProps) => () => {
const confirm = props.getWebAppConfigValue(
BooleanSetting.confirm_sequence_deletion);
const force = !(confirm ?? true);
const navigate = useNavigate();
props.dispatch(destroy(props.sequenceUuid, force))
.then(() => navigate(Path.sequences()));
.then(() => props.navigate(Path.sequences()));
};

export const isSequencePublished = (sequence: TaggedSequence) =>
Expand Down

0 comments on commit cca76b7

Please sign in to comment.