fix optional path match

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

View File

@ -5,8 +5,11 @@ import { useProtocol } from './provider'
export const useActiveChat = () => { export const useActiveChat = () => {
const { client } = useProtocol() const { client } = useProtocol()
const { params } = useMatch(':id')! const path = useMatch(':id')
const chatId = params.id!
return client.community.getChat(chatId) if (!path?.params.id) {
return
}
return client.community.getChat(path.params.id)
} }