Sfoglia il codice sorgente

fixed async call handling

Skylsmoi 6 anni fa
parent
commit
9dab43ace5
2 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  1. 8 2
      src/container/Thread.jsx
  2. 1 1
      src/css/index.styl

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

@@ -47,7 +47,7 @@ class Thread extends React.Component {
47 47
       loggedUser: props.data ? props.data.loggedUser : debug.loggedUser,
48 48
       workspace: props.data ? props.data.workspace : debug.workspace,
49 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 51
       appConfig: props.data ? props.data.appConfig : debug.appConfig
52 52
     }
53 53
 
@@ -77,7 +77,13 @@ class Thread extends React.Component {
77 77
     fetchResultThread.json = await handleFetchResult(fetchResultThread)
78 78
 
79 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 Vedi File

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