From 354245018cd63fa15bddb2fb556dc3184ab63907 Mon Sep 17 00:00:00 2001 From: Kamil Pinas Date: Thu, 28 Nov 2024 13:53:59 +0100 Subject: [PATCH 1/2] Update Message.tsx with linkifyOptions to ErrorPanel --- src/Component/Message.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Component/Message.tsx b/src/Component/Message.tsx index 32d7728..a4b3f20 100644 --- a/src/Component/Message.tsx +++ b/src/Component/Message.tsx @@ -86,7 +86,7 @@ class ConsoleMessage extends React.Component { log.data.every((message) => typeof message === 'string') && log.method === 'error' ) { - return + return } // Normal inspector From a5190467641e71836b00df9fe00ea9c96f8326c8 Mon Sep 17 00:00:00 2001 From: Kamil Pinas Date: Thu, 28 Nov 2024 13:04:34 +0000 Subject: [PATCH 2/2] added linkifyOptions to ErrorPanel --- src/Component/message-parsers/Error.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Component/message-parsers/Error.tsx b/src/Component/message-parsers/Error.tsx index 2a66b29..ee8d8c1 100644 --- a/src/Component/message-parsers/Error.tsx +++ b/src/Component/message-parsers/Error.tsx @@ -1,5 +1,6 @@ import * as React from 'react' import Linkify from 'linkifyjs/react' +import type { Options } from 'linkifyjs' function splitMessage(message: string): string { const breakIndex = message.indexOf('\n') @@ -10,7 +11,13 @@ function splitMessage(message: string): string { return message.substr(0, breakIndex) } -function ErrorPanel({ error }: { error: string }) { +function ErrorPanel({ + error, + linkifyOptions, +}: { + error: string + linkifyOptions?: Options +}) { /* This checks for error logTypes and shortens the message in the console by wrapping it a
tag and putting the first line in a tag and the other lines follow after that. This creates a nice collapsible error message */ @@ -30,7 +37,7 @@ function ErrorPanel({ error }: { error: string }) { {firstLine} - {otherErrorLines.join('\n\r')} + {otherErrorLines.join('\n\r')}
) }