mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fit message sernder can be null
This commit is contained in:
@@ -50,7 +50,7 @@ export const MessageEntitySchema = z.object({
|
|||||||
wxFullName: z.string(),
|
wxFullName: z.string(),
|
||||||
wxeMail: z.string(),
|
wxeMail: z.string(),
|
||||||
userPhoto: z.string().nullable(),
|
userPhoto: z.string().nullable(),
|
||||||
}),
|
}).nullable(),
|
||||||
reactions: z.object({
|
reactions: z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
reactedAt: z.string(),
|
reactedAt: z.string(),
|
||||||
@@ -65,7 +65,7 @@ export const MessageEntitySchema = z.object({
|
|||||||
sending: z.boolean().optional(),
|
sending: z.boolean().optional(),
|
||||||
attachments: z.array(MessageEntityAttachmentSchema).optional(),
|
attachments: z.array(MessageEntityAttachmentSchema).optional(),
|
||||||
origin: z.enum(['history', 'local', 'incoming']).optional(),
|
origin: z.enum(['history', 'local', 'incoming']).optional(),
|
||||||
requestId: z.string().optional(),
|
requestId: z.string().nullable().optional(),
|
||||||
sendAttemp: z.number().optional(),
|
sendAttemp: z.number().optional(),
|
||||||
hasAttachment: z.boolean().optional()
|
hasAttachment: z.boolean().optional()
|
||||||
})
|
})
|
||||||
@@ -110,7 +110,7 @@ export class MessageEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
meSender() {
|
meSender() {
|
||||||
return this.sender.wxUserId == SessionStore.user.UserId
|
return this.sender?.wxUserId == SessionStore.user.UserId
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { MessageEntity } from 'src/app/core/chat/entity/message';
|
|||||||
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
|
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
|
||||||
import { IMessageLocalRepository } from 'src/app/core/chat/repository/message/message-local-repository';
|
import { IMessageLocalRepository } from 'src/app/core/chat/repository/message/message-local-repository';
|
||||||
import { InstanceId } from '../../chat-service.service';
|
import { InstanceId } from '../../chat-service.service';
|
||||||
import { IMessageGetAllByRoomIdOutPut } from 'src/app/core/chat/usecase/message/message-get-all-by-room-Id';
|
|
||||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||||
@@ -95,7 +94,7 @@ export class RoomBoldSyncUseCaseService {
|
|||||||
} else if(result.isOk() && result.value.bold == 0) {
|
} else if(result.isOk() && result.value.bold == 0) {
|
||||||
const result = await this.boldLocalRepository.update(newMessage.roomId, {bold: 1})
|
const result = await this.boldLocalRepository.update(newMessage.roomId, {bold: 1})
|
||||||
} else {
|
} else {
|
||||||
tracing.hasError("failed to set bold",{})
|
// tracing.hasError("failed to set bold",{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { GetRoomListUseCaseService } from './room-get-list-use-case.service'
|
||||||
|
import { RoomSocketRepositoryService } from '../../../data/repository/room/room-socket-repository.service'
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class RoomGetListOnCreateUseCaseService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private RoomSocketRepositoryService: RoomSocketRepositoryService,
|
||||||
|
private getRoomListUseCaseService: GetRoomListUseCaseService
|
||||||
|
) {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private init() {
|
||||||
|
this.OnReceiveCreateRoom()
|
||||||
|
this.OnDeleteCreateRoom()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private OnReceiveCreateRoom() {
|
||||||
|
this.RoomSocketRepositoryService.listenToCreateRoom().subscribe((data)=> {
|
||||||
|
console.log('OnReceiveCreateRoom', data)
|
||||||
|
this.getRoomListUseCaseService.execute()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnDeleteCreateRoom() {
|
||||||
|
this.RoomSocketRepositoryService.listenToDeleteRoom().subscribe((data)=> {
|
||||||
|
console.log('OnDeleteCreateRoom7', data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,12 +26,12 @@ export class WebSocketGraylogService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.adminSocketGlobal.onclose = () => {
|
this.adminSocketGlobal.onclose = () => {
|
||||||
console.log('Admin WebSocket is closed now.');
|
// console.log('Admin WebSocket is closed now.');
|
||||||
this.connect();
|
this.connect();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.adminSocketGlobal.onerror = (error: Event) => {
|
this.adminSocketGlobal.onerror = (error: Event) => {
|
||||||
console.error('Admin WebSocket error:', error);
|
// console.error('Admin WebSocket error:', error);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user