pull/289/head
Mikunj 5 years ago
parent d4de4b13dd
commit 986d34bbd9

@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
@ -17,6 +16,7 @@ Steps to reproduce the behavior:
If applicable, add screenshots or log files to help explain your problem.
**Other information (please complete the following information):**
- Device: [e.g. PC, Mac]
- OS: [e.g. Ubuntu 16.04, Windows 10]
- Loki messenger Version or Git commit hash:
* Device: [e.g. PC, Mac]
* OS: [e.g. Ubuntu 16.04, Windows 10]
* Loki messenger Version or Git commit hash:

@ -89,11 +89,11 @@ can public keys. To test the P2P functionality on the same machine, however, req
that each client binds their message server to a different port.
You can use the following command to start a client bound to a different port.
```
yarn start-multi
```
For more than 2 clients, you can setup additional storage profiles and switch
between them using the `NODE_APP_INSTANCE` environment variable and specifying a
new localServerPort in the config.
@ -149,14 +149,15 @@ So you wanna make a pull request? Please observe the following guidelines.
the translations in
[Transifex](https://www.transifex.com/projects/p/signal-desktop).
-->
* First, make sure that your `yarn ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
* Never use plain strings right in the source code - pull them from `messages.json`!
You **only** need to modify the default locale
[`_locales/en/messages.json`](_locales/en/messages.json).
<!-- TODO:
Other locales are generated automatically based on that file and then periodically
uploaded to Transifex for translation. -->
<!-- TODO:
Other locales are generated automatically based on that file and then periodically
uploaded to Transifex for translation. -->
* [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your
changes on the latest `development` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.

@ -1,7 +1,7 @@
/* global setTimeout, clearTimeout */
const EventEmitter = require('events');
const { isEmpty } = require('lodash')
const { isEmpty } = require('lodash');
const offlinePingTime = 2 * 60 * 1000; // 2 minutes
@ -32,16 +32,17 @@ class LokiP2pAPI extends EventEmitter {
// Always set the new contact details
this.contactP2pDetails[pubKey] = {
address,
port,
timerDuration,
pingTimer: null,
isOnline: false,
};
const contactExists = isEmpty(baseDetails)
address,
port,
timerDuration,
pingTimer: null,
isOnline: false,
};
const contactExists = isEmpty(baseDetails);
const { isOnline } = baseDetails;
const detailsChanged = baseDetails.address !== address || baseDetails.port !== port
const detailsChanged =
baseDetails.address !== address || baseDetails.port !== port;
// If we had the contact details
// And we got a P2P message
@ -52,7 +53,7 @@ class LokiP2pAPI extends EventEmitter {
// We also need to set the current contact details to show online
// because they get reset to `false` above
this.setContactOnline(pubKey);
return
return;
}
/*

Loading…
Cancel
Save