mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 07:05:05 -04:00
generate unique peer names
use unique-names-generator to generate peer names instead of relying on UA. This prevents confusion when there are multiple clients on the network with same UA.
This commit is contained in:
parent
ff42ee1a3e
commit
0c7abfbf1d
4 changed files with 10 additions and 6 deletions
|
@ -1,4 +1,5 @@
|
|||
const parser = require('ua-parser-js');
|
||||
const { uniqueNamesGenerator } = require('unique-names-generator');
|
||||
|
||||
class SnapdropServer {
|
||||
|
||||
|
@ -187,7 +188,8 @@ class Peer {
|
|||
model: ua.device.model,
|
||||
os: ua.os.name,
|
||||
browser: ua.browser.name,
|
||||
type: ua.device.type
|
||||
type: ua.device.type,
|
||||
displayName: uniqueNamesGenerator({ length: 2 })
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue