Skip to content

Saleor Core: the high performance, composable, headless commerce API.

House cleaning

dominik-zeglencbe6f90c1e6d
diff --git a/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx b/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
index 9a02fc2f1a..2cfa8898d1 100644
--- a/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
+++ b/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
@@ -29,10 +29,15 @@ export const CategoryCreateView: React.StatelessComponent<
return (
<TypedCategoryCreateMutation onCompleted={handleSuccess}>
{(createCategory, createCategoryResult) => {
+ const errors = maybe(
+ () => createCategoryResult.data.categoryCreate.errors,
+ []
+ );
+
const formTransitionState = getMutationState(
createCategoryResult.called,
createCategoryResult.loading,
- maybe(() => createCategoryResult.data.categoryCreate.errors)
+ errors
);
return (
@@ -40,10 +45,7 @@ export const CategoryCreateView: React.StatelessComponent<
<WindowTitle title={i18n.t("Create category")} />
<CategoryCreatePage
saveButtonBarState={formTransitionState}
- errors={maybe(
- () => createCategoryResult.data.categoryCreate.errors,
- []
- )}
+ errors={errors}
disabled={createCategoryResult.loading}
onBack={() =>
navigate(parentId ? categoryUrl(parentId) : categoryListUrl())
diff --git a/saleor/static/dashboard-next/components/TextFieldWithChoice/TextFieldWithChoice.tsx b/saleor/static/dashboard-next/components/TextFieldWithChoice/TextFieldWithChoice.tsx
index a8157c1af5..07b311710a 100644
--- a/saleor/static/dashboard-next/components/TextFieldWithChoice/TextFieldWithChoice.tsx
+++ b/saleor/static/dashboard-next/components/TextFieldWithChoice/TextFieldWithChoice.tsx
@@ -107,6 +107,7 @@ const TextFieldWithChoice = withStyles(styles, {
{ChoiceProps.values.map(choice => (
<MenuItem
onClick={() => handleSelect(choice.value)}
+ key={choice.value}
>
{choice.label}
</MenuItem>