mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Fix filter text staying red after invalid search
This commit is contained in:
@@ -472,6 +472,7 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
|
||||
|
||||
let toLowerCase = false;
|
||||
|
||||
this.filterInput.nativeElement.style.color = '';
|
||||
if (value.startsWith('#')) {
|
||||
value = value.slice(1);
|
||||
} else if (value.startsWith('/')) {
|
||||
@@ -479,7 +480,6 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
|
||||
try {
|
||||
const regExp = new RegExp(value);
|
||||
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
|
||||
if (DEVELOPMENT) console.error(err);
|
||||
this.filterInput.nativeElement.style.color = '#ff6666';
|
||||
|
||||
Reference in New Issue
Block a user