fix optional path match
This commit is contained in:
parent
5a081466fe
commit
81f2950c19
|
@ -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…
Reference in New Issue