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
@@ -98,15 +98,18 @@ export class ChatBox implements AfterViewInit, OnDestroy {
}
addEmoji(emoji: string) {
this.toggleEmojiBox();
if (!this.message) this.message = emoji;
else if (this.input.maxLength > this.message.length) {
if (!this.message) {
this.message = emoji;
} else if (this.input.maxLength > this.message.length) {
this.message += emoji;
}
}
toggleEmojiBox() {
if (this.emojiBoxState === 'none')
if (this.emojiBoxState === 'none') {
this.emojiBoxState = 'inline-block';
else this.emojiBoxState = 'none';
} else {
this.emojiBoxState = 'none';
}
}
send(_event: Event | undefined) {
let chatType = this.chatType;
@@ -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);
}