improve chat

This commit is contained in:
Peter Maquiran
2024-08-17 22:05:57 +01:00
parent eb615d4335
commit 650c772084
43 changed files with 712 additions and 1540 deletions
@@ -5,11 +5,16 @@ import { DexieMembersTableSchema, MemberTableColumn } from './schema/members';
import { DexieRoomsTable, RoomTableColumn } from './schema/room';
import { DexieTypingsTable, TypingTableColumn } from './schema/typing';
import { MessageEntity } from '../../../domain/entity/message';
import { AttachmentTable, AttachmentTableColumn, DexieAttachmentsTableSchema } from './schema/attachment';
// import DexieMemory from 'dexie-in-memory';
import { AttachmentTableColumn, DexieAttachmentsTableSchema } from './schema/attachment';
// import FDBFactory from 'fake-indexeddb/lib/FDBFactory';
// import FDBKeyRange from 'fake-indexeddb/lib/FDBKeyRange';
// Database declaration (move this to its own module also)
export const chatDatabase = new Dexie('chat-database-infra') as Dexie & {
export const chatDatabase = new Dexie('chat-database-infra',{
// indexedDB: new FDBFactory,
// IDBKeyRange: FDBKeyRange, // Mocking IDBKeyRange
}) as Dexie & {
message: DexieMessageTable,
members: DexieMembersTableSchema,
room: DexieRoomsTable,
@@ -26,4 +31,4 @@ chatDatabase.version(1).stores({
});
chatDatabase.message.mapToClass(MessageEntity)
// Apply in-memory storage
// Apply in-memory storage