fmt-lint
This commit is contained in:
parent
aeeed1cb65
commit
7b314f21a2
|
@ -6,6 +6,7 @@ import { EventStreamContentType, fetchEventSource } from '@microsoft/fetch-event
|
|||
import { createContext, useContext, createSignal, createEffect } from 'solid-js'
|
||||
|
||||
import { useSession } from './session'
|
||||
import { Chat, Message } from '../graphql/schema/chat.gen'
|
||||
|
||||
const RECONNECT_TIMES = 2
|
||||
|
||||
|
@ -13,7 +14,7 @@ export interface SSEMessage {
|
|||
id: string
|
||||
entity: string // follower | shout | reaction
|
||||
action: string // create | delete | update | join | follow | seen
|
||||
payload: Partial<Author | Shout | Topic | Reaction>
|
||||
payload: Author | Shout | Topic | Reaction | Chat | Message
|
||||
created_at?: number // unixtime x1000
|
||||
seen?: boolean
|
||||
}
|
||||
|
|
|
@ -37,11 +37,11 @@ export const InboxProvider = (props: { children: JSX.Element }) => {
|
|||
// handling all action types: create update delete join left seen
|
||||
if (sseMessage.entity === 'message') {
|
||||
console.debug('[context.inbox]:', sseMessage.payload)
|
||||
const relivedMessage = sseMessage.payload
|
||||
const relivedMessage: Message = sseMessage.payload as Message
|
||||
setMessages((prev) => [...prev, relivedMessage])
|
||||
} else if (sseMessage.entity === 'chat') {
|
||||
console.debug('[context.inbox]:', sseMessage.payload)
|
||||
const relivedChat = sseMessage.payload
|
||||
const relivedChat: Chat = sseMessage.payload as Chat
|
||||
setChats((prev) => [...prev, relivedChat])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user