mirror of
https://github.com/status-im/dappconnect-chat-sdk.git
synced 2025-01-23 20:59:07 +00:00
fix optional path match
This commit is contained in:
parent
5b35c6b73b
commit
e1150d7f12
@ -5,8 +5,11 @@ import { useProtocol } from './provider'
|
||||
export const useActiveChat = () => {
|
||||
const { client } = useProtocol()
|
||||
|
||||
const { params } = useMatch(':id')!
|
||||
const chatId = params.id!
|
||||
const path = useMatch(':id')
|
||||
|
||||
return client.community.getChat(chatId)
|
||||
if (!path?.params.id) {
|
||||
return
|
||||
}
|
||||
|
||||
return client.community.getChat(path.params.id)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user