mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
clear chat connection
This commit is contained in:
@@ -25,4 +25,6 @@ export abstract class IDexieRepository<T, R, I = EntityTable<any, any>> {
|
||||
abstract findAll(): Promise<RepositoryResult<T[], T>>
|
||||
|
||||
abstract count(filter?: Object): Promise<RepositoryResult<number, T>>
|
||||
|
||||
abstract clear(): Promise<Result<any, any>>
|
||||
}
|
||||
|
||||
@@ -253,4 +253,13 @@ export class DexieRepository<T, R, I = EntityTable<any, any>> implements IDexieR
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
async clear() {
|
||||
try {
|
||||
const result = await this.table.clear()
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
return err(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import { Cy } from 'cypress/enum'
|
||||
import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service';
|
||||
import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service'
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service';
|
||||
import { chatDatabase } from 'src/app/infra/database/dexie/service';
|
||||
import { RoomLocalRepository } from 'src/app/module/chat/data/repository/room/room-local-repository.service'
|
||||
import { MessageLocalDataSourceService } from 'src/app/module/chat/data/repository/message/message-local-data-source.service'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -58,7 +62,9 @@ export class LoginPage implements OnInit {
|
||||
private NotificationHolderService: NotificationHolderService,
|
||||
public AgendaDataRepositoryService: AgendaDataRepositoryService,
|
||||
private NotificationRepositoryService: NotificationRepositoryService,
|
||||
private ChatServiceService: ChatServiceService
|
||||
private ChatServiceService: ChatServiceService,
|
||||
private RoomLocalRepository: RoomLocalRepository,
|
||||
private MessageLocalDataSourceService: MessageLocalDataSourceService
|
||||
|
||||
) { }
|
||||
|
||||
@@ -170,8 +176,10 @@ export class LoginPage implements OnInit {
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
await this.RoomLocalRepository.clear()
|
||||
await this.MessageLocalDataSourceService.clear()
|
||||
await this.NotificationRepositoryService.clearData()
|
||||
this.ChatServiceService.start()
|
||||
|
||||
await this.AgendaDataRepositoryService.clearSharedCalendar()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user