send offline message

This commit is contained in:
Peter Maquiran
2024-08-07 15:23:23 +01:00
parent b0a334c9dd
commit bbacc35b08
9 changed files with 172 additions and 4 deletions
+36
View File
@@ -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()
}
})
}
}