mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
remove method to infra added to message repository
This commit is contained in:
@@ -28,7 +28,7 @@ export class SignalRService {
|
||||
|
||||
this.deadConnectionBackGround = new Subject()
|
||||
this.deadConnectionBackGround.pipe(
|
||||
switchMap(() => timer(150000)),
|
||||
switchMap(() => timer(150000)), // 2 minutes 30 seconds
|
||||
).subscribe(() => {
|
||||
this.newConnection()
|
||||
})
|
||||
@@ -82,40 +82,6 @@ export class SignalRService {
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getMessage() {
|
||||
return this.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'ReceiveMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
getTyping() {
|
||||
return this.getData().pipe(
|
||||
filter((e) : e is SocketMessage<UserTypingDTO>=> e?.method == 'TypingMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
getMessageDelete() {
|
||||
return this.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'DeleteMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
getMessageUpdate() {
|
||||
return this.getData().pipe(
|
||||
filter((e) : e is SocketMessage<MessageOutPutDataDTO>=> e?.method == 'UpdateMessage'
|
||||
),
|
||||
map((e)=> e.data)
|
||||
)
|
||||
}
|
||||
|
||||
sendData<T>(input: ISignalRInput) {
|
||||
@@ -126,13 +92,6 @@ export class SignalRService {
|
||||
return this.connection.join()
|
||||
}
|
||||
|
||||
// onReconnect() {
|
||||
// const connection = this.getConnectionState()
|
||||
// return connection.pipe(
|
||||
// skip(1) // Skip the first value
|
||||
// )
|
||||
// }
|
||||
|
||||
getData<T>() {
|
||||
return this.sendDataSubject.asObservable() as BehaviorSubject<{method: string, data: T}>
|
||||
}
|
||||
|
||||
@@ -60,10 +60,11 @@ export class SignalRConnection {
|
||||
console.log('Error while starting connection: ' + error);
|
||||
if(this.hasConnectOnce) {
|
||||
setTimeout(()=> {
|
||||
this.attempReconnect();
|
||||
resolve(this.attempReconnect());
|
||||
}, 2000)
|
||||
} else {
|
||||
resolve(err(false))
|
||||
}
|
||||
resolve(err(false))
|
||||
});
|
||||
|
||||
hubConnection.onclose(() => {
|
||||
@@ -85,7 +86,9 @@ export class SignalRConnection {
|
||||
});
|
||||
|
||||
if(this.reconnect) {
|
||||
this.attempReconnect();
|
||||
resolve(this.attempReconnect());
|
||||
} else {
|
||||
resolve(err(false))
|
||||
}
|
||||
|
||||
});
|
||||
@@ -100,6 +103,7 @@ export class SignalRConnection {
|
||||
this.reconnectSubject.next(true)
|
||||
}
|
||||
|
||||
return attempConnection
|
||||
}
|
||||
|
||||
public join() {
|
||||
|
||||
Reference in New Issue
Block a user