Merge branch 'prepare-inbox' of github.com:Discours/discoursio-webapp into prepare-inbox
This commit is contained in:
commit
c1413bbf5d
|
@ -24,7 +24,6 @@ const Message = (props: Props) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('!!! props.ownId:', props.ownId)
|
|
||||||
// возвращать ID автора
|
// возвращать ID автора
|
||||||
const isOwn = props.ownId === Number(props.content.author)
|
const isOwn = props.ownId === Number(props.content.author)
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,15 @@ export const InboxView = () => {
|
||||||
const handleOpenChat = async (chat) => {
|
const handleOpenChat = async (chat) => {
|
||||||
setCurrentDialog(chat)
|
setCurrentDialog(chat)
|
||||||
try {
|
try {
|
||||||
await loadMessages({ chat: chat.id })
|
const response = await loadMessages({ chat: chat.id })
|
||||||
|
setMessages(response as unknown as MessageType[])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[loadMessages]', error)
|
console.error('[loadMessages]', error)
|
||||||
} finally {
|
} finally {
|
||||||
chatWindow.scrollTop = chatWindow.scrollHeight
|
chatWindow.scrollTop = chatWindow.scrollHeight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await loadRecipients({ days: 365 })
|
const response = await loadRecipients({ days: 365 })
|
||||||
|
@ -108,7 +110,6 @@ export const InboxView = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
console.log('!!! messages():', messages())
|
|
||||||
console.log('!!! currentDialog():', currentDialog())
|
console.log('!!! currentDialog():', currentDialog())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,6 @@ export const apiClient = {
|
||||||
|
|
||||||
createMessage: async (options: MutationCreateMessageArgs) => {
|
createMessage: async (options: MutationCreateMessageArgs) => {
|
||||||
const resp = await privateGraphQLClient.mutation(createMessage, options).toPromise()
|
const resp = await privateGraphQLClient.mutation(createMessage, options).toPromise()
|
||||||
console.log('!!! resp:', resp)
|
|
||||||
return resp.data.createMessage
|
return resp.data.createMessage
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user