create direct message

This commit is contained in:
Peter Maquiran
2024-08-19 16:01:58 +01:00
parent 29d0a9b55e
commit ae50d9b3bd
46 changed files with 500 additions and 297 deletions
+3 -3
View File
@@ -241,7 +241,7 @@ export class SignalRConnection {
}
sendData(input: ISignalRInput): Promise<Result<any, any>> {
sendData<T>(input: ISignalRInput): Promise<Result<T, any>> {
return new Promise((resolve, reject) => {
if(this.connectionStateSubject.value == true) {
@@ -249,10 +249,10 @@ export class SignalRConnection {
this.hubConnection.invoke(input.method, input.data)
this.sendDataSubject.pipe(
filter((message: any) => input.data.requestId == message?.requestId),
filter((message) => input.data.requestId == message?.data.requestId),
first()
).subscribe(value => {
resolve(ok(value))
resolve(ok(value.data as unknown as T))
console.log('Received valid value:', value);
});