fix duplicate message

This commit is contained in:
Peter Maquiran
2024-09-04 22:48:29 +01:00
parent 5315d185c2
commit 106267aee9
13 changed files with 160 additions and 79 deletions
@@ -5,7 +5,7 @@ import { MessageAttachmentFileType, MessageAttachmentSource } from "src/app/core
export const AttachmentTableSchema = z.object({
$id: z.number().optional(), // local id
$messageId: z.number(),
$messageId: z.string(),
attachmentId: z.string().optional(),
file: z.instanceof(Blob),
base64: zodDataUrlSchema.nullable().optional(),
@@ -3,7 +3,8 @@ import { MessageAttachmentFileType, MessageAttachmentSource } from 'src/app/core
import { z } from 'zod';
export const MessageTableSchema = z.object({
$id: z.number().optional(),
$id: z.string().optional(),
$createAt: z.number().optional(),
id: z.string().uuid().optional(),
roomId: z.string().uuid().optional(),
message: z.string().nullable().optional(),
@@ -48,5 +49,5 @@ export const MessageTableSchema = z.object({
export type MessageTable = z.infer<typeof MessageTableSchema>
export type DexieMessageTable = EntityTable<MessageTable, '$id'>;
export const messageTableColumn = '++$id, id, roomId, senderId, message, messageType, canEdit, oneShot, requireUnlock'
export const messageTableColumn = '$id, id, roomId, senderId, message, messageType, canEdit, oneShot, requireUnlock'
+1 -1
View File
@@ -13,7 +13,7 @@ import { BoldTableColumn, DexieBoldTable } from './instance/chat/schema/bold';
// Database declaration (move this to its own module also)
export const chatDatabase = new Dexie('chat-database-infra',{
export const chatDatabase = new Dexie('chat-database-v1',{
// indexedDB: new FDBFactory,
// IDBKeyRange: FDBKeyRange, // Mocking IDBKeyRange
}) as Dexie & {