mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 07:05:05 -04:00
Handle undefined device names - simplify + minor fix
This commit is contained in:
parent
4b15aa0417
commit
fad4632eb9
1 changed files with 7 additions and 9 deletions
|
@ -213,18 +213,16 @@ class Peer {
|
||||||
if (ua.os && ua.os.name) {
|
if (ua.os && ua.os.name) {
|
||||||
deviceName = ua.os.name.replace('Mac OS', 'Mac') + ' ';
|
deviceName = ua.os.name.replace('Mac OS', 'Mac') + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ua.device){
|
if (ua.device.model) {
|
||||||
if (ua.device.model) {
|
deviceName += ua.device.model;
|
||||||
deviceName += ua.device.model;
|
|
||||||
} else {
|
|
||||||
deviceName += ua.browser.name;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(!deviceName)
|
deviceName += ua.browser.name;
|
||||||
deviceName = 'Unknown Device';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!deviceName)
|
||||||
|
deviceName = 'Unknown Device';
|
||||||
|
|
||||||
const displayName = uniqueNamesGenerator({
|
const displayName = uniqueNamesGenerator({
|
||||||
length: 2,
|
length: 2,
|
||||||
separator: ' ',
|
separator: ' ',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue