diff --git a/src/app/components/Editor.tsx b/src/app/components/Editor.tsx index 02e183b..dec45b7 100644 --- a/src/app/components/Editor.tsx +++ b/src/app/components/Editor.tsx @@ -123,8 +123,6 @@ export default function Editor() { localStorage.setItem(PUBLIC_CODE_EDITOR_WARNINGS, JSON.stringify(warnings)) }, [warnings]) - - const getNestedValue = (obj: PublicCodeWithDeprecatedFields, path: string) => { return path.split('.').reduce((acc, key) => (acc as never)?.[key], obj); } @@ -241,6 +239,7 @@ export default function Editor() { reset({ ...defaultValues }); checkPubliccodeYmlVersion(getValues() as PublicCode); setPublicCodeImported(false); + setWarnings([]) }; const setFormDataAfterImport = async ( @@ -306,10 +305,11 @@ export default function Editor() {
-
- setWarningModalVisibility(true)} />  - {t("editor.warnings")} -
+ {!!warnings.length && +
+ setWarningModalVisibility(true)} />  +
+ }
diff --git a/src/app/components/Head.tsx b/src/app/components/Head.tsx index f4478fe..bf40026 100644 --- a/src/app/components/Head.tsx +++ b/src/app/components/Head.tsx @@ -2,8 +2,8 @@ import { documentationUrl, } from "../contents/constants"; -import { useTranslation } from "react-i18next"; import { Dropdown, DropdownMenu, DropdownToggle, Icon, LinkList, LinkListItem } from "design-react-kit"; +import { useTranslation } from "react-i18next"; import { formatLanguageLabel, getSupportedLanguages } from "../../i18n"; export const Head = (): JSX.Element => {