mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
create offline direct message
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -145,7 +145,7 @@ export class SignalRConnection {
|
||||
|
||||
} else {
|
||||
this.sendLaterSubject.next({method: 'SendMessage', args: input})
|
||||
return reject(err(false))
|
||||
return resolve(err(false))
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user