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

40 lines
946 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';
2024-08-13 10:52:35 +01:00
import { UserTypingAsyncService } from 'src/app/module/chat/data/async/socket/user-typing-async.service'
2024-08-07 15:23:23 +01:00
@NgModule({
imports: [
],
providers: [
SyncMessageRepositoryService
],
declarations: [],
schemas: [],
entryComponents: []
})
export class ChatModule {
constructor(
private message: SyncMessageRepositoryService,
2024-08-13 10:52:35 +01:00
private SignalRService: SignalRService,
private UserTypingAsyncService: UserTypingAsyncService
2024-08-07 15:23:23 +01:00
) {
this.triggerToSendOfflineMessages()
}
triggerToSendOfflineMessages() {
const result = this.SignalRService.getConnectionState()
result.subscribe((value) => {
if(value) {
this.message.sendLocalMessages()
}
})
}
}