Files
doneit-web/src/app/module/chat/chat.module.ts
T

37 lines
780 B
TypeScript
Raw Normal View History

2024-08-07 15:23:23 +01:00
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()
}
})
}
}