fix optional path match

This commit is contained in:
Pavel Prichodko 2022-08-23 18:13:25 +02:00
parent 5a081466fe
commit 81f2950c19
No known key found for this signature in database
GPG Key ID: 8E4C82D464215E83
1 changed files with 6 additions and 3 deletions

View File

@ -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)
}