Skip to content

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

Improve code readability

dominik-zeglen42f91d66f874
diff --git a/saleor/static/dashboard-next/misc.ts b/saleor/static/dashboard-next/misc.ts
index b97e7e8f2d..2d5373bc1c 100644
--- a/saleor/static/dashboard-next/misc.ts
+++ b/saleor/static/dashboard-next/misc.ts
@@ -144,11 +144,11 @@ export function getMutationState(
loading: boolean,
errorList: UserError[]
): ConfirmButtonTransitionState {
- return loading
- ? "loading"
- : called
- ? hasErrors(errorList)
- ? "error"
- : "success"
- : "default";
+ if (loading) {
+ return "loading";
+ }
+ if (called) {
+ return hasErrors(errorList) ? "error" : "success";
+ }
+ return "default";
}