瀏覽代碼

Improve Edit Recipe spinner

Tatiana Inama 6 年之前
父節點
當前提交
97805239cb
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      recipes/src/containers/Recipes/Edit/index.tsx

+ 3 - 1
recipes/src/containers/Recipes/Edit/index.tsx

@@ -33,7 +33,8 @@ class EditRecipe extends React.Component<EditRecipeProps, EditRecipeState> {
     getRecipeById(this.props.match.params.id).then(recipe => 
       this.setState({
         form: recipe,
-        loadingRecipe: false,
+      }, () => {
+        this.setState({ loadingRecipe: false })
       }))
 
   }
@@ -55,6 +56,7 @@ class EditRecipe extends React.Component<EditRecipeProps, EditRecipeState> {
 
   render() {
     const { form, loadingRecipe } = this.state;
+    console.log("loading", loadingRecipe)
     return (
       <div>
         { loadingRecipe && (<Spinner/>)}