fix: fix chat was crashing sometimes
This commit is contained in:
parent
4d7e3df859
commit
b9c8ade9bf
2 changed files with 5 additions and 1 deletions
|
|
@ -278,6 +278,10 @@ export async function connect (connectOptions: ConnectOptions) {
|
|||
return
|
||||
}
|
||||
}
|
||||
if (e.reason?.stack?.includes('chrome-extension://')) {
|
||||
// ignore issues caused by chrome extension
|
||||
return
|
||||
}
|
||||
handleError(e.reason)
|
||||
}, {
|
||||
signal: errorAbortController.signal
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ const MessageLine = ({ message, currentPlayerName, chatOpened }: { message: Mess
|
|||
return <li className={Object.entries(classes).filter(([, val]) => val).map(([name]) => name).join(' ')} data-time={message.timestamp ? new Date(message.timestamp).toLocaleString('en-US', { hour12: false }) : undefined}>
|
||||
{message.parts.map((msg, i) => {
|
||||
// Check if this is a text part that might contain a mention
|
||||
if (msg.text && currentPlayerName) {
|
||||
if (typeof msg.text === 'string' && currentPlayerName) {
|
||||
const parts = msg.text.split(new RegExp(`(@${currentPlayerName})`, 'i'))
|
||||
if (parts.length > 1) {
|
||||
return parts.map((txtPart, j) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue