File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/app/src/app/components/Preview/DevTools/Console Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,15 @@ class Console extends React.Component<StyledProps> {
214214 }
215215
216216 const { messages, filter, searchKeywords } = this . state ;
217+
218+ let searchKeywordsHasError = false ;
219+
220+ try {
221+ new RegExp ( searchKeywords ) ; // eslint-disable-line
222+ } catch ( e ) {
223+ searchKeywordsHasError = true ;
224+ }
225+
217226 return (
218227 < Container >
219228 < Messages
@@ -226,7 +235,7 @@ class Console extends React.Component<StyledProps> {
226235 variant = { this . props . theme . light ? 'light' : 'dark' }
227236 styles = { inspectorTheme ( this . props . theme ) }
228237 filter = { filter }
229- searchKeywords = { searchKeywords }
238+ searchKeywords = { searchKeywordsHasError ? '' : searchKeywords }
230239 />
231240 </ Messages >
232241 < Input evaluateConsole = { this . evaluateConsole } />
You can’t perform that action at this time.
0 commit comments