Просмотр исходного кода

Handle migration creation fail in Wizard

If a migration can't be created don't redirect to user, instead
re-enable the Finish / Next button, while displaying the error message.
Sergiu Miclea 7 лет назад
Родитель
Сommit
d855d435b8
2 измененных файлов с 3 добавлено и 0 удалено
  1. 2 0
      src/components/pages/WizardPage/WizardPage.jsx
  2. 1 0
      src/stores/WizardStore.js

+ 2 - 0
src/components/pages/WizardPage/WizardPage.jsx

@@ -397,6 +397,8 @@ class WizardPage extends React.Component<Props, State> {
         return
       }
       this.handleCreationSuccess([item])
+    }).catch(() => {
+      this.setState({ nextButtonDisabled: false })
     })
   }
 

+ 1 - 0
src/stores/WizardStore.js

@@ -125,6 +125,7 @@ class WizardStore {
       this.creatingItem = false
     }).catch(() => {
       this.creatingItem = false
+      return Promise.reject()
     })
   }