Add render messages
This commit is contained in:
parent
2631933a1a
commit
aae7b6da64
|
@ -24,7 +24,6 @@ const Message = (props: Props) => {
|
|||
})
|
||||
})
|
||||
|
||||
console.log('!!! props.ownId:', props.ownId)
|
||||
// возвращать ID автора
|
||||
const isOwn = props.ownId === Number(props.content.author)
|
||||
|
||||
|
|
|
@ -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())
|
||||
})
|
||||
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user