create offline direct message

This commit is contained in:
Peter Maquiran
2024-09-17 16:02:12 +01:00
parent 9be19bfc78
commit 1bc5707321
266 changed files with 860 additions and 2771 deletions
@@ -4,7 +4,7 @@ import { Platform } from '@ionic/angular';
import { SignalRConnection, SocketMessage } from './signalR';
import { Plugins } from '@capacitor/core';
import { switchMap } from 'rxjs/operators';
import { Result } from 'neverthrow';
import { err, Result } from 'neverthrow';
import { HubConnection } from '@microsoft/signalr';
import { ISignalRInput } from '../type';
@@ -81,8 +81,12 @@ export class SignalRService {
}
}
sendData<T>(input: ISignalRInput) {
return this.connection.sendData<T>(input)
async sendData<T>(input: ISignalRInput) {
try {
return await this.connection.sendData<T>(input)
} catch (e) {
return err('havent connected yet')
}
}
join() {
+1 -1
View File
@@ -145,7 +145,7 @@ export class SignalRConnection {
} else {
this.sendLaterSubject.next({method: 'SendMessage', args: input})
return reject(err(false))
return resolve(err(false))
}
})