fix double ping

This commit is contained in:
Jonathan Rainville 2018-11-23 14:57:16 -05:00
parent e9fb8464d4
commit 13550eff08
2 changed files with 0 additions and 19 deletions

View File

@ -17,7 +17,6 @@ import ChatBox from './ChatBox';
import ChatHeader from './ChatHeader';
import { uploadFileAndSend } from '../utils/ipfs';
class WhoIsTyping extends PureComponent {
whoIsTyping() {

View File

@ -39,24 +39,6 @@ export default class Home extends PureComponent<Props> {
componentDidMount() {
this.ipfs = new IPFS();
setInterval(() => {
const { currentChannel, users } = this.state;
status.sendJsonMessage(currentChannel, {type: "ping"});
const currentTime = (new Date().getTime());
for (let pubkey in users) {
const user = users[pubkey];
if (currentTime - user.lastSeen > 10*1000) {
user.online = false;
this.setState(prevState => ({
users: {
...prevState.users,
[pubkey]: user
}
}))
}
}
}, 5 * 1000);
}
componentWillUnmount() {