This commit is contained in:
Peter Maquiran
2024-08-30 12:41:50 +01:00
parent ac7e5ccf5b
commit d6a08c6264
33 changed files with 558 additions and 87 deletions
+5
View File
@@ -21,6 +21,8 @@ import { MessagesPageModule } from './component/messages/messages.module';
import { ContactsPageModule } from './component/contacts/contacts.module';
import { NewGroupPageModule } from './component/new-group/new-group.module';
import { ChatModule } from 'src/app/module/chat/chat.module';
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
import { BoldLocalRepository } from 'src/app/module/chat/data/repository/bold/bold-local-repository';
@NgModule({
imports: [
@@ -42,6 +44,9 @@ import { ChatModule } from 'src/app/module/chat/chat.module';
ImageCropperModule,
AttendeeModalPageModule,
ChatModule
],
providers: [
],
declarations: [
ChatPage
+2 -2
View File
@@ -61,7 +61,7 @@
<ion-label >
<span >
<div >
<div class="font-15-em" [class.bold-message]="true">
<div class="font-15-em" [class.bold-message]="boldTable?.[room.id]?.bold">
{{room.roomName}}
</div>
</div>
@@ -99,7 +99,7 @@
<ion-label >
<span >
<div >
<div class="font-15-em" [class.bold-message]="true">
<div class="font-15-em" [class.bold-message]="boldTable?.[room.id]?.bold">
{{room.roomName}}
</div>
</div>
+17 -5
View File
@@ -23,7 +23,8 @@ import { map, tap } from 'rxjs/operators';
import { interval, Subscription } from 'rxjs';
import { RoomTable } from 'src/app/infra/database/dexie/instance/chat/schema/room';
import { RoomType } from 'src/app/core/chat/entity/group';
import { BoldLocalRepository } from 'src/app/module/chat/data/repository/bold/bold-local-repository'
import { BoldTable } from 'src/app/infra/database/dexie/instance/chat/schema/bold';
@Component({
selector: 'app-chat',
templateUrl: './chat.page.html',
@@ -64,6 +65,8 @@ export class ChatPage implements OnInit {
RoomType = RoomType
boldTable: {[key: string]: BoldTable} = {}
constructor(
private modalController: ModalController,
private timeService: TimeService,
@@ -73,18 +76,27 @@ export class ChatPage implements OnInit {
public RouteService: RouteService,
private ChatServiceService: ChatServiceService,
private roomLocalDataSourceService: RoomLocalRepository,
private chatServiceService: ChatServiceService
private boldLocalRepository: BoldLocalRepository
) {
window.onresize = (event) => {
if (window.innerWidth > 701) {
this.modalController.dismiss();
}
};
}
this.showLoader = true;
this.boldLocalRepository.listen().subscribe((data) => {
const distributionObject: {[key: string]: BoldTable} = {};
for (const distribution of data) {
distributionObject[distribution.roomId] = distribution;
}
this.boldTable = distributionObject
})
}
// Fetch all items using useLiveQuery
@@ -127,7 +139,7 @@ export class ChatPage implements OnInit {
this.routerSubscription = this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd && event.url.startsWith('/home/chat')) {
this.routeCheck()
this.ChatServiceService.getRoomList()
// this.ChatServiceService.getRoomList()
}
});
@@ -275,7 +275,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}) as any
this.chatServiceService.removeBoldFromRoom({roomId: this.roomId})
}
messageStatus(message: MessageEntity) {
@@ -422,7 +422,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
setTimeout(() => {
this.scrollToBottomClicked()
}, 100)
this.chatServiceService.removeBoldFromRoom({roomId: this.roomId})
});
}
listenToDeleteMessage() {