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;
|
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';
|
||||||
|
|||||||
Reference in New Issue
Block a user