mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
send offline message
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { SignalRService } from 'src/app/module/chat/infra/socket/signal-r.service'
|
||||
import { SyncMessageRepositoryService } from './data/service/sync-repository/sync-message-repository.service';
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
||||
],
|
||||
providers: [
|
||||
SyncMessageRepositoryService
|
||||
],
|
||||
declarations: [],
|
||||
schemas: [],
|
||||
entryComponents: []
|
||||
})
|
||||
export class ChatModule {
|
||||
|
||||
constructor(
|
||||
private message: SyncMessageRepositoryService,
|
||||
private SignalRService: SignalRService
|
||||
) {
|
||||
|
||||
|
||||
this.triggerToSendOfflineMessages()
|
||||
}
|
||||
|
||||
|
||||
triggerToSendOfflineMessages() {
|
||||
const result = this.SignalRService.getConnectionState()
|
||||
|
||||
result.subscribe((value) => {
|
||||
if(value) {
|
||||
this.message.sendLocalMessages()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user