add delete button

This commit is contained in:
Peter Maquiran
2024-07-26 16:54:32 +01:00
parent 6ca952e3b6
commit f4935ca8eb
3 changed files with 47 additions and 15 deletions
+33 -8
View File
@@ -7,6 +7,36 @@ import { v4 as uuidv4 } from 'uuid'
import { UserTypingDTO } from '../../data/dto/typing/typingInputDTO';
import { MessageOutPutDataDTO } from '../../data/dto/message/messageOutputDTO';
var msgObj = {
roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
senderId:312,
message:"message enviada",
messageType:312,
canEdit:true,
oneShot:false,
requestId:"testing"
};
// var deletObj = {
// roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
// senderId:312,
// messageId:"message enviada",
// requestId:"testing"
// };
// var reactObj = {
// roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
// memberId:2,
// messageId:"e7074c10-4f92-458c-adb2-774ec2d42992",
// reaction:"reacted",
// requestId:"testingReaction"
// };
const typingObj = {
roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
userId: 312,
userName:"usertyping",
requestId:"testing"
};
export class SignalRConnection {
private hubConnection: signalR.HubConnection;
@@ -76,7 +106,7 @@ export class SignalRConnection {
if(this.connectionStateSubject.value == true) {
console.log('join=================')
this.hubConnection.invoke("Join", SessionStore.user.UserId, SessionStore.user.FullName);
this.hubConnection.invoke("Join", 312, SessionStore.user.FullName);
//this.hubConnection.invoke("Join", 105, "UserFirefox");
} else {
this.sendLaterSubject.next({method: 'SendMessage', args:["Join", 312, "Daniel"]})
@@ -89,7 +119,7 @@ export class SignalRConnection {
if(this.connectionStateSubject.value == true) {
console.log('sendMessage', data)
this.hubConnection.invoke("SendMessage", data)
this.hubConnection.invoke("SendMessage", msgObj)
this.messageSubject.pipe(
filter((message: any) => data.requestId == message?.requestId),
@@ -116,12 +146,7 @@ export class SignalRConnection {
console.log('send typing', data)
try {
this.hubConnection.invoke("Typing", {
userName: data.UserName,
roomId: data.roomId,
userId: data.userId +'',
requestId
} as any)
this.hubConnection.invoke("Typing", typingObj)
} catch (error) {}