Added live message_state updates, fixed sonner theme

This commit is contained in:
Alois 2026-04-03 00:03:24 +02:00
commit 7ebe028629
5 changed files with 138 additions and 21 deletions

View file

@ -19,7 +19,7 @@ const message = z.object({
tint: z.string().length(7).startsWith("#").optional(),
avatar: z.boolean().optional(),
display: z.boolean().optional(),
message_state: z.enum(["read", "received", "sent", "sending", "awaiting"]),
message_state: z.enum(["read", "received", "sent", "sending", "awaiting"]), // awaiting for 'internal' use
});
export const failedUser = {
@ -148,6 +148,18 @@ export const socket = {
}),
response: z.object({}),
},
message_state: {
request: z.object({
chat_partner_id: z.number(),
timestamp: z.number(),
message_state: message.shape.message_state,
}),
response: z.object({
chat_partner_id: z.number(),
message_state: message.shape.message_state,
timestamp: z.number(),
}),
},
} satisfies Record<string, { request: z.ZodType; response: z.ZodType }>;
export type Socket = typeof socket;