|
@@ -22,7 +22,8 @@ import {
|
22
|
22
|
putThreadIsArchived,
|
23
|
23
|
putThreadIsDeleted,
|
24
|
24
|
putThreadRestoreArchived,
|
25
|
|
- putThreadRestoreDeleted
|
|
25
|
+ putThreadRestoreDeleted,
|
|
26
|
+ putThreadRead
|
26
|
27
|
} from '../action.async.js'
|
27
|
28
|
|
28
|
29
|
class Thread extends React.Component {
|
|
@@ -108,20 +109,24 @@ class Thread extends React.Component {
|
108
|
109
|
handleFetchResult(await fetchResultThread),
|
109
|
110
|
handleFetchResult(await fetchResultThreadComment)
|
110
|
111
|
])
|
111
|
|
- .then(([resThread, resComment]) => this.setState({
|
112
|
|
- content: resThread.body,
|
113
|
|
- listMessage: resComment.body.map(c => ({
|
114
|
|
- ...c,
|
115
|
|
- timelineType: 'comment',
|
116
|
|
- created: (new Date(c.created)).toLocaleString(),
|
117
|
|
- author: {
|
118
|
|
- ...c.author,
|
119
|
|
- avatar_url: c.author.avatar_url
|
120
|
|
- ? c.author.avatar_url
|
121
|
|
- : generateAvatarFromPublicName(c.author.public_name)
|
122
|
|
- }
|
123
|
|
- }))
|
124
|
|
- }))
|
|
112
|
+ .then(([resThread, resComment]) => {
|
|
113
|
+ this.setState({
|
|
114
|
+ content: resThread.body,
|
|
115
|
+ listMessage: resComment.body.map(c => ({
|
|
116
|
+ ...c,
|
|
117
|
+ timelineType: 'comment',
|
|
118
|
+ created: (new Date(c.created)).toLocaleString(),
|
|
119
|
+ author: {
|
|
120
|
+ ...c.author,
|
|
121
|
+ avatar_url: c.author.avatar_url
|
|
122
|
+ ? c.author.avatar_url
|
|
123
|
+ : generateAvatarFromPublicName(c.author.public_name)
|
|
124
|
+ }
|
|
125
|
+ }))
|
|
126
|
+ })
|
|
127
|
+
|
|
128
|
+ putThreadRead(loggedUser, config.apiUrl, content.workspace_id, content.content_id)
|
|
129
|
+ })
|
125
|
130
|
.catch(e => console.log('Error loading Thread data.', e))
|
126
|
131
|
}
|
127
|
132
|
|