From d9dfd61d50ffdbb858ce4366baa03b1a6f4a336c Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Fri, 16 Dec 2022 11:30:03 +0300 Subject: [PATCH] no-sse --- src/context/inbox.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/context/inbox.tsx b/src/context/inbox.tsx index 734e66c5..b0fcad17 100644 --- a/src/context/inbox.tsx +++ b/src/context/inbox.tsx @@ -1,10 +1,10 @@ import { Accessor, createMemo, JSX, onMount } from 'solid-js' import { createContext, createSignal, useContext } from 'solid-js' -import { createChatClient } from '../graphql/privateGraphQLClient' +// import { createChatClient } from '../graphql/privateGraphQLClient' import type { Chat, Message, MutationCreateMessageArgs } from '../graphql/types.gen' import { apiClient } from '../utils/apiClient' -import newMessage from '../graphql/subs/new-message' -import type { Client } from '@urql/core' +// import newMessage from '../graphql/subs/new-message' +// import type { Client } from '@urql/core' import { pipe, subscribe } from 'wonka' import { loadMessages } from '../stores/inbox' @@ -16,7 +16,7 @@ type InboxContextType = { loadChats: () => Promise getMessages?: (chatId: string) => Promise sendMessage?: (args: MutationCreateMessageArgs) => void - unsubscribe: () => void + // unsubscribe: () => void } } @@ -29,7 +29,7 @@ export function useInbox() { export const InboxProvider = (props: { children: JSX.Element }) => { const [chats, setChats] = createSignal([]) const [messages, setMessages] = createSignal([]) - const subclient = createMemo(() => createChatClient()) + // const subclient = createMemo(() => createChatClient()) const loadChats = async () => { try { const newChats = await apiClient.getChats({ limit: 50, offset: 0 }) @@ -72,7 +72,7 @@ export const InboxProvider = (props: { children: JSX.Element }) => { } const { unsubscribe } = pipe( - subclient().subscription(newMessage, {}), + () => null, // subclient().subscription(newMessage, {}), subscribe((result) => { console.info('[subscription]') console.debug(result)