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

Merge branch '151-leave-moderators-in-session'

parents 60707bb8 a6adb5ba
No related merge requests found
......@@ -61,6 +61,7 @@ export class ModeratorsComponent implements OnInit {
return;
}
this.moderatorService.add(this.roomId, list[0].id).subscribe();
this.moderatorService.addToHistory(this.roomId, list[0].id);
this.moderators.push(new Moderator(list[0].id, loginId));
this.translationService.get('room-page.moderator-added').subscribe(msg => {
this.notificationService.show(msg);
......
......@@ -27,7 +27,7 @@
<p>{{room.description.trim()}}</p>
</mat-card-content>
<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="20px">
<mat-grid-list cols="{{viewModuleCount}}" rowHeight="1:1" *ngIf="viewModuleCount > 1">
<mat-grid-list cols="{{viewModuleCount}}" rowHeight="1:1" *ngIf="viewModuleCount > 1 && this.moderationEnabled">
<mat-grid-tile>
<button id="question_answer-button"
mat-icon-button [disableRipple]="true"
......@@ -49,7 +49,7 @@
</button>
</mat-grid-tile>
</mat-grid-list>
<div fxLayout="row" fxLayoutAlign="center" *ngIf="viewModuleCount <= 1" class="question-button-div">
<div fxLayout="row" fxLayoutAlign="center" *ngIf="!this.moderationEnabled" class="question-button-div">
<button id="question_answer-button2" mat-icon-button [disableRipple]="true"
routerLink="/creator/room/{{ room.shortId }}/comments" aria-labelledby="question_answer">
<mat-icon matBadge="{{commentCounter}}" class="main-icon"
......
......@@ -19,6 +19,7 @@ export class ModeratorService extends BaseHttpService {
user: '/user',
find: '/find'
};
private joinDate: Date;
constructor(private http: HttpClient) {
super();
......@@ -66,4 +67,10 @@ export class ModeratorService extends BaseHttpService {
catchError(this.handleError('getUserData', []))
);
}
addToHistory(roomId: string, userId: string): void {
this.joinDate = new Date(Date.now());
const connectionUrl = `${ this.apiUrl.base + this.apiUrl.user }/${ userId }/roomHistory`;
this.http.post(connectionUrl, { roomId: roomId, lastVisit: this.joinDate.getTime() }, httpOptions).subscribe(() => {});
}
}
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