Skip to content
Snippets Groups Projects
Commit cb68f7fb authored by Tom Käsler's avatar Tom Käsler
Browse files

Fixup unacknowledged comment counter

Add the unacknowledged coment counter to creators
Only query counter when neccessary
parent 926dfb25
No related merge requests found
...@@ -28,6 +28,7 @@ export class RoomCreatorPageComponent extends RoomPageComponent implements OnIni ...@@ -28,6 +28,7 @@ export class RoomCreatorPageComponent extends RoomPageComponent implements OnIni
updCommentThreshold: number; updCommentThreshold: number;
deviceType = localStorage.getItem('deviceType'); deviceType = localStorage.getItem('deviceType');
viewModuleCount = 1; viewModuleCount = 1;
moderatorCommentCounter: number;
constructor(protected roomService: RoomService, constructor(protected roomService: RoomService,
protected notification: NotificationService, protected notification: NotificationService,
...@@ -53,7 +54,11 @@ export class RoomCreatorPageComponent extends RoomPageComponent implements OnIni ...@@ -53,7 +54,11 @@ export class RoomCreatorPageComponent extends RoomPageComponent implements OnIni
afterRoomLoadHook() { afterRoomLoadHook() {
if (this.moderationEnabled) { if (this.moderationEnabled) {
this.viewModuleCount = this.viewModuleCount + 1; this.viewModuleCount = this.viewModuleCount + 1;
this.commentService.countByRoomId(this.room.id, false).subscribe(commentCounter => {
this.moderatorCommentCounter = commentCounter;
});
} }
} }
updateGeneralSettings() { updateGeneralSettings() {
......
...@@ -45,14 +45,14 @@ export class RoomModeratorPageComponent extends RoomPageComponent implements OnI ...@@ -45,14 +45,14 @@ export class RoomModeratorPageComponent extends RoomPageComponent implements OnI
} }
this.room = room; this.room = room;
this.isLoading = false; this.isLoading = false;
this.commentService.countByRoomId(this.room.id, true) this.commentService.countByRoomId(this.room.id, true).subscribe(commentCounter => {
.subscribe(commentCounter => {
this.commentCounter = commentCounter; this.commentCounter = commentCounter;
});
this.commentService.countByRoomId(this.room.id, false).subscribe(commentCounter => {
this.moderatorCommentCounter = commentCounter;
}); });
if (this.moderationEnabled) {
this.commentService.countByRoomId(this.room.id, false).subscribe(commentCounter => {
this.moderatorCommentCounter = commentCounter;
});
}
this.wsCommentService.getCommentStream(this.room.id).subscribe((message: Message) => { this.wsCommentService.getCommentStream(this.room.id).subscribe((message: Message) => {
const msg = JSON.parse(message.body); const msg = JSON.parse(message.body);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment