fixed String compares

This commit is contained in:
Zener 2020-12-19 14:13:37 +01:00
parent 1ff0d5bbda
commit 61cc433064
2 changed files with 7 additions and 7 deletions

View File

@ -34,8 +34,8 @@ function loginComponent() {
var urlParams = new URLSearchParams(window.location.search);
let uname = urlParams.get('Username')||'';
let passwd = '';
let port = Number(urlParams.get('Port') || window.location.protocol=='file:' ? '9092': window.location.port );
let server = urlParams.get('Server')|| window.location.protocol=='file:' ? '127.0.0.1' : window.location.hostname;
let port = Number(urlParams.get('Port') || window.location.protocol==='file:' ? '9092': window.location.port );
let server = urlParams.get('Server')|| window.location.protocol==='file:' ? '127.0.0.1' : window.location.hostname;
return {
view: () => {
return m(
@ -45,17 +45,17 @@ function loginComponent() {
src: '../data/retroshare.svg',
alt: 'retroshare_icon'
}),
m('input' + (uname == '' ? '[autofocus]':''), {
m('input' + (uname === '' ? '[autofocus]':''), {
type: 'text',
value: uname,
placeholder: 'Username',
onchange: e => (uname = e.target.value)
}),
m('input'+ (uname != '' ? '[autofocus]':''), {
m('input'+ (uname !== '' ? '[autofocus]':''), {
type: 'password',
placeholder: 'Password',
onchange: e => (passwd = e.target.value),
onkeyup: e => {if (e.code=='Enter') loginBtn.click();}
onkeyup: e => {if (e.code==='Enter') loginBtn.click();}
}),
m('.extra', [
'Port:',

View File

@ -154,9 +154,9 @@ const Identity = () => {
m('p', 'Owner node ID:'),
m('p', details.mPgpId),
m('p', 'Created on:'),
m('p', typeof details.mPublishTS =='object' ? new Date(details.mPublishTS.xint64 * 1000).toLocaleString():'undefiend'),
m('p', typeof details.mPublishTS ==='object' ? new Date(details.mPublishTS.xint64 * 1000).toLocaleString():'undefiend'),
m('p', 'Last used:'),
m('p', typeof details.mLastUsageTS =='object' ? new Date(details.mLastUsageTS.xint64 * 1000).toLocaleDateString():'undefiend'),
m('p', typeof details.mLastUsageTS ==='object' ? new Date(details.mLastUsageTS.xint64 * 1000).toLocaleDateString():'undefiend'),
]),
m(
'button',