Fix filter text staying red after invalid search

This commit is contained in:
Stubenhocker1399
2019-09-11 13:43:10 +02:00
parent 7deecebe28
commit b8595dce7f
@@ -472,6 +472,7 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
let toLowerCase = false; let toLowerCase = false;
this.filterInput.nativeElement.style.color = '';
if (value.startsWith('#')) { if (value.startsWith('#')) {
value = value.slice(1); value = value.slice(1);
} else if (value.startsWith('/')) { } else if (value.startsWith('/')) {
@@ -479,7 +480,6 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
try { try {
const regExp = new RegExp(value); const regExp = new RegExp(value);
this.filterChatLogLines(regExp, toLowerCase); this.filterChatLogLines(regExp, toLowerCase);
this.filterInput.nativeElement.style.color = '';
} catch (err) {// If the user inputs invalid regExp we just notify him by changing text color to red } catch (err) {// If the user inputs invalid regExp we just notify him by changing text color to red
if (DEVELOPMENT) console.error(err); if (DEVELOPMENT) console.error(err);
this.filterInput.nativeElement.style.color = '#ff6666'; this.filterInput.nativeElement.style.color = '#ff6666';