aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/App.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-08 12:28:42 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:54 +0300
commitbbfb81c2bc8d6afba550299e7138eeb2c58956d3 (patch)
tree7bac2ebe816e577c38040ccd5a07fb36bbb249e9 /vnext/src/App.js
parent9c0f90c01b918cc56ac996eebdc21bf58ba07bb1 (diff)
Pass EventSource connection to child components
Diffstat (limited to 'vnext/src/App.js')
-rw-r--r--vnext/src/App.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js
index 54326220..7978abe5 100644
--- a/vnext/src/App.js
+++ b/vnext/src/App.js
@@ -69,9 +69,6 @@ export default class App extends React.Component {
if (!jsonMsg.mid) {
this.pm.current.onMessage(jsonMsg);
}
- if (jsonMsg.rid && this.thread.current) {
- this.thread.current.onReply(jsonMsg);
- }
} catch (err) {
console.log(err);
}
@@ -151,12 +148,12 @@ export default class App extends React.Component {
} />
<Route exact path="/post" render={(props) => <Post visitor={user} {...props} />} />
<Route exact path="/pm" render={(props) => <Contacts visitor={user} {...props} />} />
- <Route exact path="/pm/:user" render={(props) => <Chat ref={this.pm} visitor={user} {...props} />} />
+ <Route exact path="/pm/:user" render={(props) => <Chat connection={this.es} visitor={user} {...props} />} />
<Route exact path="/:user/friends" render={(props) => <Friends user={props.match.params.user} {...props} />} />
<Route exact path="/:user/readers" render={(props) => <Readers user={props.match.params.user} {...props} />} />
<Route exact path="/:user" render={(props) => <Blog key={props.match.params.user} visitor={user} {...props} />} />
<Route exact path="/tag/:tag" render={(props) => <Tag visitor={user} {...props} />} />
- <Route exact path="/:user/:mid" render={(props) => <Thread ref={this.thread} visitor={user} {...props} />} />
+ <Route exact path="/:user/:mid" render={(props) => <Thread connection={this.es} visitor={user} {...props} />} />
</Switch>
</section>
{