Browse Source

fixed async call handling

Skylsmoi 6 years ago
parent
commit
9dab43ace5
2 changed files with 9 additions and 3 deletions
  1. 8 2
      src/container/Thread.jsx
  2. 1 1
      src/css/index.styl

+ 8 - 2
src/container/Thread.jsx View File

47
       loggedUser: props.data ? props.data.loggedUser : debug.loggedUser,
47
       loggedUser: props.data ? props.data.loggedUser : debug.loggedUser,
48
       workspace: props.data ? props.data.workspace : debug.workspace,
48
       workspace: props.data ? props.data.workspace : debug.workspace,
49
       content: props.data ? props.data.content : debug.content,
49
       content: props.data ? props.data.content : debug.content,
50
-      listMessage: props.data ? props.data.content.message_list : debug.listMessage,
50
+      listMessage: props.data ? [] : debug.listMessage,
51
       appConfig: props.data ? props.data.appConfig : debug.appConfig
51
       appConfig: props.data ? props.data.appConfig : debug.appConfig
52
     }
52
     }
53
 
53
 
77
     fetchResultThread.json = await handleFetchResult(fetchResultThread)
77
     fetchResultThread.json = await handleFetchResult(fetchResultThread)
78
 
78
 
79
     this.setState({
79
     this.setState({
80
-      content: fetchResultThread.json
80
+      content: {
81
+        id: fetchResultThread.json.id,
82
+        status: fetchResultThread.json.status,
83
+        title: fetchResultThread.json.title,
84
+        type: fetchResultThread.json.type
85
+      },
86
+      listMessage: fetchResultThread.json.message_list
81
     })
87
     })
82
   }
88
   }
83
 
89
 

+ 1 - 1
src/css/index.styl View File

68
       color white
68
       color white
69
 
69
 
70
 .activeEditionTitle
70
 .activeEditionTitle
71
-  .wsFileThread
71
+  .wsContentThread
72
     &__header
72
     &__header
73
       &__editionmode
73
       &__editionmode
74
         display block
74
         display block