Add render messages

This commit is contained in:
ilya-bkv 2022-12-05 10:39:41 +03:00
parent 2631933a1a
commit aae7b6da64
3 changed files with 3 additions and 4 deletions

View File

@ -24,7 +24,6 @@ const Message = (props: Props) => {
})
})
console.log('!!! props.ownId:', props.ownId)
// возвращать ID автора
const isOwn = props.ownId === Number(props.content.author)

View File

@ -53,13 +53,15 @@ export const InboxView = () => {
const handleOpenChat = async (chat) => {
setCurrentDialog(chat)
try {
await loadMessages({ chat: chat.id })
const response = await loadMessages({ chat: chat.id })
setMessages(response as unknown as MessageType[])
} catch (error) {
console.error('[loadMessages]', error)
} finally {
chatWindow.scrollTop = chatWindow.scrollHeight
}
}
onMount(async () => {
try {
const response = await loadRecipients({ days: 365 })
@ -108,7 +110,6 @@ export const InboxView = () => {
}
createEffect(() => {
console.log('!!! messages():', messages())
console.log('!!! currentDialog():', currentDialog())
})

View File

@ -283,7 +283,6 @@ export const apiClient = {
createMessage: async (options: MutationCreateMessageArgs) => {
const resp = await privateGraphQLClient.mutation(createMessage, options).toPromise()
console.log('!!! resp:', resp)
return resp.data.createMessage
},