replicate to mobile

This commit is contained in:
Peter Maquiran
2024-09-06 14:38:30 +01:00
parent 27eeebb767
commit e7887d4e5a
10 changed files with 399 additions and 79 deletions
@@ -6,6 +6,6 @@ export const BoldTableSchema = z.object({
bold: z.number()
})
export type BoldTable = z.infer<typeof BoldTableSchema>
export type BoldTable = z.infer<typeof BoldTableSchema>;
export type DexieBoldTable = EntityTable<BoldTable, 'roomId'>;
export const BoldTableColumn = 'roomId, bold'
export const BoldTableColumn = 'roomId, bold';
@@ -0,0 +1,12 @@
import { EntityTable } from 'Dexie';
import { z } from 'zod';
export const UserPhotoTableSchema = z.object({
wxUserId: z.string(),
blob: z.instanceof(Blob),
attachmentId: z.string()
})
export type UserPhotoTable = z.infer<typeof UserPhotoTableSchema>
export type DexieUserPhotoTable = EntityTable<UserPhotoTable, 'wxUserId'>;
export const UserPhotoTableColumn = 'wxUserId'
+5 -2
View File
@@ -8,6 +8,7 @@ import { MessageEntity } from 'src/app/core/chat/entity/message';
import { AttachmentTableColumn, DexieAttachmentsTableSchema } from 'src/app/infra/database/dexie/instance/chat/schema/attachment';
import { DexieDistributionTable, DistributionTable, DistributionTableColumn } from './instance/chat/schema/destribution';
import { BoldTableColumn, DexieBoldTable } from './instance/chat/schema/bold';
import { DexieUserPhotoTable, UserPhotoTable, UserPhotoTableColumn } from './instance/chat/schema/user-foto';
// import FDBFactory from 'fake-indexeddb/lib/FDBFactory';
// import FDBKeyRange from 'fake-indexeddb/lib/FDBKeyRange';
@@ -23,7 +24,8 @@ export const chatDatabase = new Dexie('chat-database-v1',{
typing: DexieTypingsTable,
attachment: DexieAttachmentsTableSchema,
distribution: DexieDistributionTable,
bold: DexieBoldTable
bold: DexieBoldTable,
userPhoto: DexieUserPhotoTable
};
chatDatabase.version(1).stores({
@@ -33,7 +35,8 @@ chatDatabase.version(1).stores({
typing: TypingTableColumn,
attachment: AttachmentTableColumn,
distribution: DistributionTableColumn,
bold:BoldTableColumn
bold:BoldTableColumn,
userPhotoTable: UserPhotoTableColumn
});
chatDatabase.message.mapToClass(MessageEntity)