Skip to content

Commit 08c17f3

Browse files
committed
fix: reset yaml on rest form
1 parent 07f0be8 commit 08c17f3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/app/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const App = () => {
2222
const [isPublicCodeImported, setPublicCodeImported] = useState(false);
2323
const [warnings, setWarnings] = useState<Warning[]>([]);
2424
const [data, setData] = useState<
25-
PublicCode | PublicCodeWithDeprecatedFields
25+
PublicCode | PublicCodeWithDeprecatedFields | undefined
2626
>();
2727
const { t } = useTranslation();
2828

src/app/components/Editor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const defaultValues = {
122122
};
123123

124124
type EditorProps = {
125-
setData: (data: PublicCode) => void;
125+
setData: (data: PublicCode | undefined) => void;
126126
setWarnings: (items: Warning[]) => void;
127127
isPublicCodeImported: boolean;
128128
setPublicCodeImported: (value: boolean) => void;
@@ -275,6 +275,7 @@ export default function Editor({
275275
);
276276

277277
const resetFormHandler = () => {
278+
setData(undefined);
278279
dispatch(resetPubliccodeYmlLanguages());
279280
reset({ ...defaultValues });
280281
checkPubliccodeYmlVersion(getValues() as PublicCode);

0 commit comments

Comments
 (0)