fix-wonka
This commit is contained in:
parent
4f47a7334d
commit
b061ed59da
|
@ -51,8 +51,6 @@ export const InboxView = () => {
|
|||
|
||||
let chatWindow
|
||||
|
||||
const onMessage = (payload) => console.log('!!! payload', payload)
|
||||
// const listener = setListener
|
||||
const handleOpenChat = async (chat: Chat) => {
|
||||
setCurrentDialog(chat)
|
||||
try {
|
||||
|
@ -70,7 +68,6 @@ export const InboxView = () => {
|
|||
try {
|
||||
const response = await loadRecipients({ days: 365 })
|
||||
setRecipients(response as unknown as Author[])
|
||||
setListener(onMessage)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ export function useInbox() {
|
|||
export const InboxProvider = (props: { children: JSX.Element }) => {
|
||||
const [chats, setChats] = createSignal<Chat[]>([])
|
||||
const [listener, setListener] = createSignal(console.debug)
|
||||
const subclient = createMemo<Client>(() => createChatClient(listener()))
|
||||
const subclient = createMemo<Client>(() => createChatClient())
|
||||
const loadChats = async () => {
|
||||
try {
|
||||
const newChats = await apiClient.getChats({ limit: 50, offset: 0 })
|
||||
|
|
|
@ -49,10 +49,9 @@ const options: ClientOptions = {
|
|||
|
||||
export const privateGraphQLClient = createClient(options)
|
||||
|
||||
export const createChatClient = (onMessage) => {
|
||||
export const createChatClient = () => {
|
||||
const sseClient = createSSEClient({
|
||||
url: apiBaseUrl + '/messages',
|
||||
onMessage
|
||||
url: apiBaseUrl + '/messages'
|
||||
})
|
||||
|
||||
const sseExchange = subscriptionExchange({
|
||||
|
|
Loading…
Reference in New Issue
Block a user