cleaned up useless conditions

pull/1705/head
antelle 2021-01-28 08:08:11 +01:00
parent 61067391b6
commit 7123345341
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
5 changed files with 6 additions and 8 deletions

View File

@ -858,7 +858,7 @@ class AppModel {
path = Storage[storage].getPathForName(file.name);
}
const optionsForLogging = { ...options };
if (optionsForLogging && optionsForLogging.opts && optionsForLogging.opts.password) {
if (optionsForLogging.opts && optionsForLogging.opts.password) {
optionsForLogging.opts = { ...optionsForLogging.opts };
optionsForLogging.opts.password = '***';
}

View File

@ -27,7 +27,7 @@ class MenuSectionModel extends Model {
removeByFile(file) {
const items = this.items;
items.find((item) => {
if (item.file === file || item.file === file) {
if (item.file === file) {
items.remove(item);
return true;
}
@ -39,7 +39,7 @@ class MenuSectionModel extends Model {
replaceByFile(file, newItem) {
const items = this.items;
items.find((item, ix) => {
if (item.file === file || item.file === file) {
if (item.file === file) {
items[ix] = newItem;
return true;
}

View File

@ -686,9 +686,7 @@ class AppView extends View {
this.views.open.toggleMore();
}
} else {
if (menuItem) {
this.model.menu.select({ item: menuItem });
}
this.model.menu.select({ item: menuItem });
}
} else {
this.showSettings();

View File

@ -64,7 +64,7 @@ class FieldViewDate extends FieldViewText {
this.picker = null;
}
newVal = new Date(newVal);
if (!newVal || isNaN(newVal.getTime())) {
if (isNaN(newVal.getTime())) {
newVal = null;
}
super.endEdit(newVal, extra);

View File

@ -104,7 +104,7 @@ class FieldViewOtp extends FieldViewText {
this.resetOtp();
return;
}
this.otpValue = pass || '';
this.otpValue = pass;
this.otpTimeLeft = timeLeft || 0;
this.otpValidUntil = Date.now() + timeLeft;
if (!this.editing) {