Skip to content

Commit

Permalink
undoing changes after pressing stop button
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoMorenoSirius committed Jun 21, 2024
1 parent 64ff21a commit 6317e68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apps/mocksi-lite/content/Toast/PlayToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import closeIcon from "../../public/close-icon.png";
import editIcon from "../../public/edit-icon.png";
import labeledIcon from "../../public/labeled-icon.png";
import stopIcon from "../../public/stop-icon.png";
import { getAlterations, loadAlterations, sendMessage } from "../../utils";
import { getAlterations, loadAlterations, sendMessage, undoModifications } from "../../utils";
import { setEditorMode } from "../EditMode/editMode";
import Toast from "./index";

Expand All @@ -15,9 +15,9 @@ interface PlayToastProps {
const PlayToast = ({ onChangeState, close }: PlayToastProps) => {
const handleEdit = async () => {
const alterations = await getAlterations();
onChangeState(RecordingState.EDITING);
loadAlterations(alterations, true);
setEditorMode(true);
onChangeState(RecordingState.EDITING);
};
const handleHideToast = () => {
sendMessage("updateToPauseIcon");
Expand All @@ -39,7 +39,10 @@ const PlayToast = ({ onChangeState, close }: PlayToastProps) => {
<div className={"flex gap-2"}>
<Button
variant={Variant.icon}
onClick={() => onChangeState(RecordingState.CREATE)}
onClick={() => {
undoModifications()
onChangeState(RecordingState.CREATE)
}}
>
<img src={stopIcon} alt={"stopIcon"} />
</Button>
Expand Down

0 comments on commit 6317e68

Please sign in to comment.