Tweak some single line elseifs

This commit is contained in:
Stubenhocker1399
2019-09-10 15:39:09 +02:00
parent cd27246069
commit 70eed8c686
2 changed files with 16 additions and 11 deletions
@@ -455,8 +455,9 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
this.unFocus();
this.filterChatLogLines('', false);
return;
} else {
this.filterColor = this.bg;
}
else this.filterColor = this.bg;
this.autoClear = setTimeout(() => {
this.filterTab.nativeElement.value = '';
@@ -470,8 +471,9 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
let toLowerCase = false;
if (value.startsWith('#')) value = value.slice(1);
else if (value.startsWith('/')) {
if (value.startsWith('#')) {
value = value.slice(1);
} else if (value.startsWith('/')) {
value = value.slice(1);
try {
const regExp = new RegExp(value);
@@ -482,8 +484,7 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
this.filterTab.nativeElement.style.color = '#ff6666';
}
return;
}
else {
} else {
value = value.toLowerCase();
toLowerCase = true;
}
@@ -499,10 +500,11 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
textContent = textContent.slice(10);
if (typeof content === 'string') {
if (caseSensitive)
if (caseSensitive) {
lines[i].hidden = !textContent.toLowerCase().includes(content);
else
} else {
lines[i].hidden = !textContent.includes(content);
}
} else {
lines[i].hidden = !textContent.match(content);
}